-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding missing cents zeros #85
base: master
Are you sure you want to change the base?
Adding missing cents zeros #85
Conversation
douglasresende
commented
Mar 17, 2018
if (integerVal !== "0") { | ||
formatted = integerVal + centsSeparator + centsVal; | ||
} | ||
else { | ||
formatted = centsSeparator + centsVal; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Douglas,
I've faced the same issue as you did, and tried your pull request.
It seems that this curly brace needs to be removed as well, otherwise the script will break.
var str = get(); | ||
var new_str = fix_cents_by_str(str); | ||
var price = fix_cents_by_str(price_format(str)); | ||
if (new_str != price) set(price); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one, I think it should be if (new_str != price) set(new_str)
.
After applying the above changes, it works as expected.