Skip to content

Commit

Permalink
Improve emulation of fixed-precision decimal numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshetline committed Jul 29, 2020
1 parent 499f533 commit a3c35f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/platform-specifics.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ module.exports = {
n = fixedBigDecimal(s);
}

if (typeof fixedBigDecimal.precision === 'number' && typeof n.toDecimalPlaces === 'function') {
n = n.toDecimalPlaces(fixedBigDecimal.precision);
if (typeof fixedBigDecimal.precision === 'number' && typeof n.toSignificantDigits === 'function') {
n = n.toSignificantDigits(fixedBigDecimal.precision);
}

return n;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-z",
"version": "3.3.1",
"version": "3.3.2",
"description": "JSON for everyone.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit a3c35f9

Please sign in to comment.