bfintal / Counter-Up2

Counter-Up is a lightweight module that counts up to a targeted number when the number becomes visible.
MIT License
193 stars 65 forks source link

Counter does not handle decimals correctly #14

Open hoermannklaus opened 2 years ago

hoermannklaus commented 2 years ago

I setup the Counter-Up2 and came across a problem, when using decimal values.

Using the Codepen example https://codepen.io/bfintal/pen/zYzOGpZ and replacing the value 1,123,456.78 in the HTML with a decimal value "1.234" the counter starts counting up from 1 to 1000, as it interprets the number not as "1.234" but as "1234" (one thousand two hundred thirty four). The same when I exchange the dot with a semicolon.

Am I missing out on something? It said it can handle decimals.

Thanks

hoermannklaus commented 2 years ago

When I replace the counterUp version in the Codepen to 1.0.1 the decimals work again. Maybe there is a bug somewhere in Version 2.