strconv.FormatFloat(10.900, 'f', -1, 64)
This will result in 10.9
.
The -1
as the third parameter tells the function to print the fewest digits necessary to accurately represent the float.
strconv.FormatFloat(10.900, 'f', -1, 64)
This will result in 10.9
.
The -1
as the third parameter tells the function to print the fewest digits necessary to accurately represent the float.