money_format works incorrectly for fractions < 0.1 #61

Merged
merged 2 commits into from Dec 20, 2012

2 participants

@evgenius

Hello,

money_format works incorrectly for fractions < 0.1

For instance, for frac_digits=2 the function returned:
money_format("%!i", 31.011); // 31.1
money_format("%!i", 31.01);  // 31.01
money_format("%!i", 31.009); // 31.1

evgenius added some commits Dec 20, 2012
@evgenius evgenius Removed an extraneous parameter of parseFloat call a75e2b0
@evgenius evgenius Fixed incorrect fraction formatting in money_format
The function worked incorrectly when the length of the fraction was less than frac_digits.

For instance, for frac_digits=2 the function returned:
money_format("%!i", 31.011); // 31.1
money_format("%!i", 31.01);  // 31.01
money_format("%!i", 31.009); // 31.1
163580b
@kvz kvz was assigned Dec 20, 2012
@kvz
Owner

Awesome, thank you!

@kvz kvz merged commit 46e5c8b into kvz:master Dec 20, 2012
@evgenius

You're welcome. Glad I could help.

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