26 lines
450 B
Go
26 lines
450 B
Go
|
// Package wrapper ...
|
||
|
//
|
||
|
// Description : wrapper ...
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 2023-05-05 13:39
|
||
|
package wrapper
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestString_ToFloat32(t *testing.T) {
|
||
|
var str String
|
||
|
str = "12345.123"
|
||
|
fmt.Println(str)
|
||
|
fmt.Println(str.ToFloat32())
|
||
|
fmt.Println(str.ToFloat64())
|
||
|
fmt.Println(str.ToNumber())
|
||
|
fmt.Println(str.ToDouble())
|
||
|
fmt.Println(str.ToInt())
|
||
|
fmt.Println(str.ToUint())
|
||
|
}
|