Leocardoso94 / animated-number-vue

Super easy way to animate numbers.
https://codesandbox.io/s/v68x95mo30
MIT License
211 stars 31 forks source link

Formatting numbers #49

Open juliandreas opened 4 years ago

juliandreas commented 4 years ago

Hello,

I think this is a great library and thanks for creating it.

One issue though: When using number like "09" (for example) it gets auto formatted to "9". Wouldn't it be better if the user did the formatting by default and not the tool? Because I have a lot of cases where I want it to be "09".

seifsay3d-zz commented 4 years ago

Hi @jllagerberg you can do that using

<animated-number :round="true" value="09" :formatValue="numberFormatter" />

numberFormatter(value) { // return here value after manupliction / padding },

juliandreas commented 4 years ago

I understand that, but my point was that the formatting should be up to the user and not the tool.

So if for example I have the number "09" and want it to be "9", it is up to me to format it.