package main import ( \"fmt\" \"strconv\" ) func main() { k := 10/3.0 i := fmt.Sprintf(\"%.2f\", k) f,_ := strconv.ParseFloat(i, 2) fmt.Pri
I really don't see the point, but you could do something like this without strconv:
package main import ( "fmt" ) func main() { untruncated := 10 / 3.0 truncated := float64(int(untruncated * 100)) / 100 fmt.Println(untruncated, truncated) }