number_slide_animation icon indicating copy to clipboard operation
number_slide_animation copied to clipboard

Support for basic number formatting

Open gilescm opened this issue 4 years ago • 5 comments

Addresses issue #2.

Please note this is only addresses integer number formatting and does not support formatting for numbers with decimals.

I updated the example so you can quickly see the new output, but let me know and I can revert!

gilescm avatar Oct 18 '20 12:10 gilescm

Nice Work @gilescm I'll take a look at your PR soon!

kiesman99 avatar Oct 18 '20 20:10 kiesman99

Hey @gilescm,

As far as I can see you can only format the numbers automatically. Do you think it would be possible to add floating point numbers for example:

1.0079 => "One point zero, zero, seven, nine"

kiesman99 avatar Oct 18 '20 20:10 kiesman99

Maybe we could extract the dot from the number String input of the Widget itself.

kiesman99 avatar Oct 18 '20 20:10 kiesman99

Yeah I think so! I was thinking about it but a little aphrenrsive about changing too much.

We could detect a dot (comma for europeans) of floating point numbers and if present split the string, then run the first section through the formatting method and append the dot with the digits to the output?

gilescm avatar Oct 18 '20 21:10 gilescm

That's the way I'd do it.

However i would animate everything that is a number in the string. That way the user can decide which delimiter he likes to use.

kiesman99 avatar Mar 03 '21 21:03 kiesman99