Commit 0c4b51e8 by feidy

add strconv func

parent 1f86b38b
......@@ -2,6 +2,20 @@ package utils
import "strconv"
func IntToString(a int)string{
func IntToString(a int) string {
return strconv.Itoa(a)
}
func Float64ToString(a float64) string {
return strconv.FormatFloat(a, 'E', -1, 64)
}
func StringToInt(s string) int {
i, _ := strconv.Atoi(s)
return i
}
func StringToFloat64(s string) float64 {
f, _ := strconv.ParseFloat(s, 64)
return f
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment