Skip to content

Commit 534b9f2

Browse files
authored
Update format.go
1 parent 6e1f2b6 commit 534b9f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/fmt/format.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func (f *fmt) fmtFloat(v float64, size int, verb rune, prec int) {
536536
tail := tailBuf[:0]
537537

538538
hasDecimalPoint := false
539-
meetNonzeroDigit := false
539+
sawNonzeroDigit := false
540540
// Starting from i = 1 to skip sign at num[0].
541541
for i := 1; i < len(num); i++ {
542542
switch num[i] {
@@ -554,16 +554,16 @@ func (f *fmt) fmtFloat(v float64, size int, verb rune, prec int) {
554554
fallthrough
555555
default:
556556
if num[i] != '0' {
557-
meetNonzeroDigit = true
557+
sawNonzeroDigit = true
558558
}
559-
// Count significant digits after meeting first non-zero digit
560-
if meetNonzeroDigit {
559+
// Count significant digits after saw the first non-zero digit.
560+
if sawNonzeroDigit {
561561
digits--
562562
}
563563
}
564564
}
565565
if !hasDecimalPoint {
566-
// 0 should contribute once to digits
566+
// decimal 0 should contribute once to digits.
567567
if num[1] == '0' && len(num) == 2 {
568568
digits--
569569
}

0 commit comments

Comments
 (0)