增加string包装类型
This commit is contained in:
25
string_test.go
Normal file
25
string_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// 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())
|
||||
}
|
Reference in New Issue
Block a user