diff --git a/zutils/parse.go b/zutils/parse.go new file mode 100644 index 0000000000000000000000000000000000000000..0624605e512b2c6dfff2fa6d3a0d8a43a4632ff1 --- /dev/null +++ b/zutils/parse.go @@ -0,0 +1,24 @@ +package zutils + +import "strconv" + +func ParseFloat(s string) float64 { + f, _ := strconv.ParseFloat(s, 64) + + return f +} +func ParseInt(s string) int { + f, _ := strconv.ParseInt(s, 10, 32) + + return int(f) +} +func ParseInt64(s string) int64 { + f, _ := strconv.ParseInt(s, 10, 64) + + return f +} +func ParseUInt(s string) uint64 { + f, _ := strconv.ParseUint(s, 10, 64) + + return f +}