go代码使用 fmt.Sscanf()实现转换科学计数的例子,但是只能转换成int型
package main import "fmt" func main() { var ( old = "1.00000023e+06" new float64 ) n, err := fmt.Sscanf(old, "%f", &new) if err != nil { fmt.Println(err.Error()) } else if 1 != n { fmt.Println("n is not one") } fmt.Println(uint64(new)) }