Comparing version 0.0.37 to 0.0.38
@@ -377,5 +377,7 @@ "use strict"; | ||
function round(value, currency) { | ||
var _a; | ||
var _a, _b, _c, _d, _e; | ||
const factor = Math.pow(10, (_a = decimalDigits(currency)) !== null && _a !== void 0 ? _a : 2); | ||
return Math.round(Math.round(value * factor * 10) / 10) / factor; | ||
const decimals = ((_d = (_c = (_b = value.toString().split(".")) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) - 1; | ||
return (Math.round((value + (decimals <= ((_e = decimalDigits(currency)) !== null && _e !== void 0 ? _e : 2) + 5 ? 0 : Math.pow(10, -decimals))) * factor) / | ||
factor); | ||
} | ||
@@ -382,0 +384,0 @@ Currency.round = round; |
{ | ||
"name": "isoly", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "PayFunc", |
Sorry, the diff of this file is not supported yet
909139
18980