Skip to content

fix: strip trailing zeros after interior fractional zeros - #72

Open
official-burak wants to merge 1 commit into
visionmedia:masterfrom
official-burak:fix/decimal-places-trailing-zeros
Open

official-burak wants to merge 1 commit into
visionmedia:masterfrom
official-burak:fix/decimal-places-trailing-zeros

Conversation

@official-burak

Copy link
Copy Markdown

Thanks for catching this. The trailing-zero strip only dropped zeros after a fractional part that started with a non-zero digit, so 1.500 became 1.5 while 1.050 stayed 1.050.

This now strips any trailing zeros after the decimal, and the decimal point if nothing is left, which matches the 1536 vs 1075 case. I added a test for both values. fixedDecimals is unchanged.

Fixes #69

The old replace only dropped zeros when the fractional part started
with a non-zero digit, so 1.500 became 1.5 while 1.050 stayed 1.050.

Fixes visionmedia#69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decimalPlaces is incosistent

1 participant