Leocardoso94/animated-number-vue

Formatting numbers

juliandreas opened this issue · 2 comments

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".

Hi @jllagerberg you can do that using

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

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

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.