pet*_*rSO 5
-11fg
startLat := strconv.FormatFloat(o.Coordinate.Longitude, 'f', -1, 64)
例如,
package main
import (
"fmt"
"strconv"
)
func main() {
f := 64.2345
s := strconv.FormatFloat(f, 'g', 1, 64)
fmt.Println(s)
s = strconv.FormatFloat(f, 'f', -1, 64)
fmt.Println(s)
}
输出:
6e+01
64.2345