UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

25 lines (24 loc) 841 B
"use strict"; var _atomicFormatter = require("./atomic-formatter"); describe('atomicFormatter', () => { // NOTE: decimal and thousands separators are locale-dependent it.each` value | decimalPlaces | expected ${BigInt(1234567890)} | ${2} | ${'12,345,678.90'} ${BigInt(189)} | ${6} | ${'0.000189'} ${BigInt(1000000)} | ${6} | ${'1.000000'} ${BigInt(1000000)} | ${0} | ${'1,000,000'} `('formats value $value with $decimalPlaces decimal places to $expected', _ref => { let { value, decimalPlaces, expected } = _ref; const formattedValue = (0, _atomicFormatter.atomicFormatter)({ value, decimalPlaces }); expect(formattedValue).toBe(expected); }); }); //# sourceMappingURL=atomic-formatter.test.js.map