Closed EvanHerman closed 2 years ago
I've tried formatting the number with the following, but it doesn't look like commas are preserved during the animation. Any ideas how I can ensure the numbers include the commas?
formatValue = (value) => value.toFixed(0).toLocaleString( "en-US" );
And only 2 minutes later I was able to figure it out
formatValue = (value) => value.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
Closing 👌
I've tried formatting the number with the following, but it doesn't look like commas are preserved during the animation. Any ideas how I can ensure the numbers include the commas?