Comparing version 0.1.18 to 0.1.19
@@ -374,5 +374,7 @@ const currencies = [ | ||
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); | ||
} | ||
@@ -379,0 +381,0 @@ Currency.round = round; |
{ | ||
"name": "isoly", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "PayFunc", |
Sorry, the diff of this file is not supported yet
894468
18563