sparkalow / angular-count-to

Angular directive to animate counting to a number
MIT License
150 stars 95 forks source link

Doesn't handle floats #4

Open daniel-halldorsson opened 10 years ago

daniel-halldorsson commented 10 years ago

count-to converts any input to integers, not always desirable.

sparkalow commented 10 years ago

It was created with couting to and from whole numbers in mind.
I'll look into supporting floats.

Shawful commented 10 years ago

When this supports floats it will do great things for my project. I can't wait!

charlesharvey commented 10 years ago

https://github.com/charlesharvey/angular-count-to/blob/master/src/count-to.js

i made a version which supports floats, and returns numbers to 2 decimal places.

kaushalye commented 9 years ago

Thanks charlesharvey> BTW, a small fix to the above script (line 32) e.innerHTML = parseFloat(Math.round(num * 100) / 100).toFixed(2) ;

charlesharvey commented 9 years ago

thanks @kaushalye. Fixed now!

miguelrincon commented 9 years ago

Probably in a similar way, it could provide support for filters. Using $filter('number') to let angular handle the formatting.

readygosports commented 8 years ago

the one support float is great

johhansantana commented 7 years ago

this one doesn't support float still I asume. I'll try @charlesharvey 's