Skip to content

Commit f8a72e5

Browse files
committed
Runtime: fix float to string
1 parent dea09f9 commit f8a72e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/stdlib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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) {
622+
if (p && ! (s.indexOf('e') > 0)) {
623623
// remove trailing zeroes
624624
var i = s.length - 1; while (s.charAt(i) == '0') i--;
625625
if (s.charAt(i) == '.') i--;

0 commit comments

Comments
 (0)