summaryrefslogtreecommitdiff
path: root/src/strconv/ftoa.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strconv/ftoa.go')
-rw-r--r--src/strconv/ftoa.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/strconv/ftoa.go b/src/strconv/ftoa.go
index 8b3d33e4e7..a7ccbe6727 100644
--- a/src/strconv/ftoa.go
+++ b/src/strconv/ftoa.go
@@ -35,10 +35,11 @@ var float64info = floatInfo{52, 11, -1023}
// 'g' ('e' for large exponents, 'f' otherwise), or
// 'G' ('E' for large exponents, 'f' otherwise).
//
-// The precision prec controls the number of digits
-// (excluding the exponent) printed by the 'e', 'E', 'f', 'g', and 'G' formats.
+// The precision prec controls the number of digits (excluding the exponent)
+// printed by the 'e', 'E', 'f', 'g', and 'G' formats.
// For 'e', 'E', and 'f' it is the number of digits after the decimal point.
-// For 'g' and 'G' it is the total number of digits.
+// For 'g' and 'G' it is the maximum number of significant digits (trailing
+// zeros are removed).
// The special precision -1 uses the smallest number of digits
// necessary such that ParseFloat will return f exactly.
func FormatFloat(f float64, fmt byte, prec, bitSize int) string {