1
0
mirror of https://github.com/golang/go synced 2024-11-24 04:50:07 -07:00

updates comments

This commit is contained in:
yah01 2020-02-26 16:15:56 +08:00 committed by GitHub
parent 8021bb2912
commit 405d51b12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -556,14 +556,14 @@ func (f *fmt) fmtFloat(v float64, size int, verb rune, prec int) {
if num[i] != '0' {
sawNonzeroDigit = true
}
// Count significant digits after saw the first non-zero digit.
// Count significant digits after the first non-zero digit.
if sawNonzeroDigit {
digits--
}
}
}
if !hasDecimalPoint {
// decimal 0 should contribute once to digits.
// Leading digit 0 should contribute once to digits.
if len(num) == 2 && num[1] == '0' {
digits--
}