File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ function caml_format_float (fmt, x) {
606606 s = x . toExponential ( prec - 1 ) ;
607607 var j = s . indexOf ( 'e' ) ;
608608 var exp = + s . slice ( j + 1 ) ;
609- if ( exp < - 4 || x . toFixed ( 0 ) . length > prec ) {
609+ if ( exp < - 4 || x >= 1e21 || x . toFixed ( 0 ) . length > prec ) {
610610 // remove trailing zeroes
611611 var i = j - 1 ; while ( s . charAt ( i ) == '0' ) i -- ;
612612 if ( s . charAt ( i ) == '.' ) i -- ;
@@ -619,7 +619,7 @@ function caml_format_float (fmt, x) {
619619 var p = prec ;
620620 if ( exp < 0 ) { p -= exp + 1 ; s = x . toFixed ( p ) ; }
621621 else while ( s = x . toFixed ( p ) , s . length > prec + 1 ) p -- ;
622- if ( p && ! ( s . indexOf ( 'e' ) > 0 ) ) {
622+ if ( p ) {
623623 // remove trailing zeroes
624624 var i = s . length - 1 ; while ( s . charAt ( i ) == '0' ) i -- ;
625625 if ( s . charAt ( i ) == '.' ) i -- ;
You can’t perform that action at this time.
0 commit comments