animated-number-vue icon indicating copy to clipboard operation
animated-number-vue copied to clipboard

Formatting numbers

Open juliandreas opened this issue 5 years ago • 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".

juliandreas avatar Apr 11 '20 16:04 juliandreas

Hi @jllagerberg you can do that using

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

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

seifsay3d-zz avatar Apr 28 '20 07:04 seifsay3d-zz

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.

juliandreas avatar Apr 28 '20 08:04 juliandreas