Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Preserve decimal values with trailing zeros #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sidonath
Copy link

This addresses issue #38, but introduces a huge backwards incompatibility where the decimal value is always shown if a formatting rule allows it.

Update: Whoops, discovered a bug when using thousands separator in format options. Working on a fix. It should be good to merge now

This addresses issue HubSpot#38, but introduces a huge backwards
incompatibility where the decimal value is always shown if
formatting rule allows it.
@monofonik
Copy link

Just what I'm after - thanks a lot

@zackbloom
Copy link
Contributor

The deal breaker is the backwards incompatibility, as wanting trailing zeros cut off is a common desire. The choice needs to be expressible in the format string.

@sidonath
Copy link
Author

sidonath commented Mar 5, 2014

@zackbloom ok, I could do that, but shouldn't this be the default behavior going forward? Since with the current implementation going from "1.19" to "1.20" will not look pretty due to digits disappearing.

Maybe instead there should be a config option, say roundDecimals. It would be set to true by default and would issue a deprecation warning saying that the default value will be changed to false in the next release or 1.0 (and to continue using current behavior, users should set the roundDecimals to true manually.

Adding this option to format string would IMHO needlessly complicate parsing and usage.

@zackbloom
Copy link
Contributor

The format string now allows you to configure the number of decimal places, so it seems like this would fit in as well, but I take your point.

@dulacp
Copy link

dulacp commented Apr 30, 2014

🍰
That working for me guys, any plans on integrating this in master ?

@TrevorBurnham
Copy link
Contributor

This looks great to me. @marcneuwirth Care to review and merge?

@zefrench
Copy link

As I dont have any clue about how to add the currency symbol on the odometer, I post this question here, maybe someone will help me.

Regards.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants