react-native-animated-numbers
Version:
Module that shows number changes through simple animation
12 lines (11 loc) • 522 B
JavaScript
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