UNPKG

react-native-animated-numbers

Version:
19 lines (17 loc) 700 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createNumberArrayWithComma = createNumberArrayWithComma; exports.toAbsoluteInteger = toAbsoluteInteger; function toAbsoluteInteger(num) { return Math.abs(Math.floor(num)); } function createNumberArrayWithComma(numberString, locale = 'en-US') { // Convert the string to a number and use Intl.NumberFormat to format it const formattedString = new Intl.NumberFormat(locale).format(Number(numberString)); // Split the formatted string into an array of numbers and commas const arr = Array.from(formattedString, char => char === ',' ? char : Number(char)); return arr; } //# sourceMappingURL=index.js.map