Comparing version 0.1.2 to 0.1.3
@@ -6,3 +6,4 @@ import { CurrencyCode } from "./CurrencyCode"; | ||
function from(currencyCode: CurrencyCode): Currency; | ||
function round(value: number, currency: Currency): number; | ||
function decimalDigits(currency: Currency): number | undefined; | ||
} |
@@ -370,2 +370,8 @@ export var Currency; | ||
Currency.from = from; | ||
function round(value, currency) { | ||
var _a; | ||
const factor = Math.pow(10, (_a = decimalDigits(currency)) !== null && _a !== void 0 ? _a : 2); | ||
return Math.round((value + Number.EPSILON) * factor) / factor; | ||
} | ||
Currency.round = round; | ||
function decimalDigits(currency) { | ||
@@ -372,0 +378,0 @@ return { |
{ | ||
"name": "isoly", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "PayFunc", |
Sorry, the diff of this file is not supported yet
882766
18114