mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-22 06:29:24 +08:00
24 lines
270 B
Go
24 lines
270 B
Go
package anyUtil
|
|
|
|
import "fmt"
|
|
|
|
func ExampleAnyToFloat32() {
|
|
f := "3"
|
|
res, _ := AnyToFloat32(f)
|
|
|
|
fmt.Printf("%T\n", res)
|
|
|
|
// Output:
|
|
// float32
|
|
}
|
|
|
|
func ExampleAnyToFloat64() {
|
|
f := "5"
|
|
res, _ := AnyToFloat64(f)
|
|
|
|
fmt.Printf("%T\n", res)
|
|
|
|
// Output:
|
|
// float64
|
|
}
|