// CastToFloat32 takes an interface{} type or any Object type and
// attempts to convert it to the Float32 Object type.
CastToFloat32 takes an interface{} type or any Object type and
attempts to convert it to the Float32 Object type.
// CastToFloat32 takes an interface {} type or any Object type and // attempts to convert it to the Float32 Object type .
func CastToFloat32(v interface{}) (Float32, bool) {
	switch pt := v.(type) {
	case *Float32:
		return *pt, true
	case Float32:
		return pt, true
	case *float32:
		t := *pt
		return Float32(t), true
	case float32:
		t := pt
		return Float32(t), true
	case *Boolean:
		t := *pt
		return func(t Boolean) Float32 {
			if t {
				return Float32(1)
			}
			return Float32(0)
		}(t), true
	case Boolean:
		t := pt
		return func(t Boolean) Float32 {
			if t {
				return Float32(1)
			}
			return Float32(0)
		}(t), true
	case *Date64:
		t := *pt
		return Float32(t), true
	case Date64:
		t := pt
		return Float32(t), true
	case *Decimal128:
		t := *pt
		return Float32(t.toI64()), true
	case Decimal128:
		t := pt
		return Float32(t.toI64()), true
	case *Duration:
		t := *pt
		return Float32(t), true
	case Duration:
		t := pt
		return Float32(t), true
	case *Float16:
		t := *pt
		return Float32(t.tof32()), true
	case Float16:
		t := pt
		return Float32(t.tof32()), true
	case *Float64:
		t := *pt
		return Float32(t), true
	case Float64:
		t := pt
		return Float32(t), true
	case *Int16:
		t := *pt
		return Float32(t), true
	case Int16:
		t := pt
		return Float32(t), true
	case *Int32:
		t := *pt
		return Float32(t), true
	case Int32:
		t := pt
		return Float32(t), true
	case *Int64:
		t := *pt
		return Float32(t), true
	case Int64:
		t := pt
		return Float32(t), true
	case *Int8:
		t := *pt
		return Float32(t), true
	case Int8:
		t := pt
		return Float32(t), true
	case *Time32:
		t := *pt
		return Float32(t), true
	case Time32:
		t := pt
		return Float32(t), true
	case *Time64:
		t := *pt
		return Float32(t), true
	case Time64:
		t := pt
		return Float32(t), true
	case *Timestamp:
		t := *pt
		return Float32(t), true
	case Timestamp:
		t := pt
		return Float32(t), true
	case *Uint16:
		t := *pt
		return Float32(t), true
	case Uint16:
		t := pt
		return Float32(t), true
	case *Uint32:
		t := *pt
		return Float32(t), true
	case Uint32:
		t := pt
		return Float32(t), true
	case *Uint64:
		t := *pt
		return Float32(t), true
	case Uint64:
		t := pt
		return Float32(t), true
	case *Uint8:
		t := *pt
		return Float32(t), true
	case Uint8:
		t := pt
		return Float32(t), true
	default:
		return 0, false
	}
}
func CastToFloat32 ( v interface { } ) ( Float32 , bool ) { switch pt := v . ( type ) { case * Float32 : return * pt , true case Float32 : return pt , true case * float32 : t := * pt return Float32 ( t ) , true case float32 : t := pt return Float32 ( t ) , true case * Boolean : t := * pt return func ( t Boolean ) Float32 { if t { return Float32 ( 1 ) } return Float32 ( 0 ) } ( t ) , true case Boolean : t := pt return func ( t Boolean ) Float32 { if t { return Float32 ( 1 ) } return Float32 ( 0 ) } ( t ) , true case * Date64 : t := * pt return Float32 ( t ) , true case Date64 : t := pt return Float32 ( t ) , true case * Decimal128 : t := * pt return Float32 ( t . toI64 ( ) ) , true case Decimal128 : t := pt return Float32 ( t . toI64 ( ) ) , true case * Duration : t := * pt return Float32 ( t ) , true case Duration : t := pt return Float32 ( t ) , true case * Float16 : t := * pt return Float32 ( t . tof32 ( ) ) , true case Float16 : t := pt return Float32 ( t . tof32 ( ) ) , true case * Float64 : t := * pt return Float32 ( t ) , true case Float64 : t := pt return Float32 ( t ) , true case * Int16 : t := * pt return Float32 ( t ) , true case Int16 : t := pt return Float32 ( t ) , true case * Int32 : t := * pt return Float32 ( t ) , true case Int32 : t := pt return Float32 ( t ) , true case * Int64 : t := * pt return Float32 ( t ) , true case Int64 : t := pt return Float32 ( t ) , true case * Int8 : t := * pt return Float32 ( t ) , true case Int8 : t := pt return Float32 ( t ) , true case * Time32 : t := * pt return Float32 ( t ) , true case Time32 : t := pt return Float32 ( t ) , true case * Time64 : t := * pt return Float32 ( t ) , true case Time64 : t := pt return Float32 ( t ) , true case * Timestamp : t := * pt return Float32 ( t ) , true case Timestamp : t := pt return Float32 ( t ) , true case * Uint16 : t := * pt return Float32 ( t ) , true case Uint16 : t := pt return Float32 ( t ) , true case * Uint32 : t := * pt return Float32 ( t ) , true case Uint32 : t := pt return Float32 ( t ) , true case * Uint64 : t := * pt return Float32 ( t ) , true case Uint64 : t := pt return Float32 ( t ) , true case * Uint8 : t := * pt return Float32 ( t ) , true case Uint8 : t := pt return Float32 ( t ) , true default : return 0 , false } }
CastToFloat32 takes an interface{} type or any Object type and
attempts to convert it to the Float32 Object type.
CastToFloat32 takes an interface {} type or any Object type and attempts to convert it to the Float32 Object type .
// Also handles when v is nil