UNPKG

react-native-animated-numbers

Version:
12 lines (11 loc) 522 B
export function toAbsoluteInteger(num) { return Math.abs(Math.floor(num)); } export 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