Skip to content

Commit b1c0113

Browse files
committed
Merge pull request #72 from hdgarrood/fix-show-number
Fix Show Number for integers outside the Int range
2 parents edde446 + ac98eff commit b1c0113

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Data/Show.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ exports.showIntImpl = function (n) {
77
};
88

99
exports.showNumberImpl = function (n) {
10-
/* jshint bitwise: false */
11-
return n === (n | 0) ? n + ".0" : n.toString();
10+
var str = n.toString();
11+
return str.indexOf("e") === -1 && str.indexOf(".") === -1 ?
12+
str + ".0" :
13+
str;
1214
};
1315

1416
exports.showCharImpl = function (c) {

0 commit comments

Comments
 (0)