UNPKG

nambas

Version:

A simple JS library to format numbers using in-built Intl.NumberFormat

25 lines 806 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = formatter; const types_1 = require("./types"); function formatter(nambaFormat) { const options = {}; switch (nambaFormat) { case types_1.ENambaFormat.THOUSANDS: options.style = types_1.EStyle.DECIMAL; options.locale = 'en-US'; break; case types_1.ENambaFormat.FRENCH_PERCENTAGE: options.style = types_1.EStyle.PERCENT; options.locale = 'fr-FR'; break; case types_1.ENambaFormat.GERMAN_PERCENTAGE: options.style = types_1.EStyle.PERCENT; options.locale = 'de-DE'; break; default: break; } return options; } //# sourceMappingURL=formatter.js.map