diff --git a/numfmt.go b/numfmt.go index cae88d64ab..265fe28379 100644 --- a/numfmt.go +++ b/numfmt.go @@ -5136,7 +5136,10 @@ func (nf *numberFormat) positiveHandler() string { var fmtNum bool for _, token := range nf.section[nf.sectionIdx].Items { if token.TType == nfp.TokenTypeGeneral { - return strconv.FormatFloat(nf.number, 'G', 10, 64) + if isNum, precision, _ := isNumeric(nf.value); isNum && precision > 11 { + return strconv.FormatFloat(nf.number, 'G', 10, 64) + } + return nf.value } if inStrSlice(supportedNumberTokenTypes, token.TType, true) != -1 { fmtNum = true diff --git a/numfmt_test.go b/numfmt_test.go index 61bf41bb48..c3e1a9928b 100644 --- a/numfmt_test.go +++ b/numfmt_test.go @@ -11,6 +11,7 @@ func TestNumFmt(t *testing.T) { for _, item := range [][]string{ {"123", "general", "123"}, {"-123", ";general", "-123"}, + {"12345678901", "General", "12345678901"}, {"43543.5448726851", "General", "43543.54487"}, {"-43543.5448726851", "General", "-43543.54487"}, {"1234567890.12345", "General", "1234567890"},