Skip to content

Commit e86ffd8

Browse files
committed
Merge branch 'patch-1' of github.com:hilmishariff/phpjs into hilmishariff-patch-1
2 parents bc18dab + bc022c5 commit e86ffd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/strings/number_format.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function number_format(number, decimals, dec_point, thousands_sep) {
5656
s = '',
5757
toFixedFix = function(n, prec) {
5858
var k = Math.pow(10, prec);
59-
return '' + Math.round(n * k) / k;
59+
return '' + (Math.round(n * k) / k).toFixed(prec);
6060
};
6161
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
6262
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n))
@@ -71,4 +71,4 @@ function number_format(number, decimals, dec_point, thousands_sep) {
7171
.join('0');
7272
}
7373
return s.join(dec);
74-
}
74+
}

0 commit comments

Comments
 (0)