-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove delimiter on number with currency field #2428
Remove delimiter on number with currency field #2428
Conversation
@@ -5,7 +5,7 @@ | |||
|
|||
<div class="input-group number-with-currency <%= "number-with-currency-with-select" unless currency %> js-number-with-currency"> | |||
<div class="input-group-addon number-with-currency-symbol"></div> | |||
<%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: ''), class: 'form-control number-with-currency-amount', required: required %> | |||
<%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: '', delimiter: ''), class: 'form-control number-with-currency-amount', required: required %> |
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.
This can probably be a number_field
as well. It's only used in admin forms for numeric values.
@luukveenis fixed! |
That was a nice idea @luukveenis, but we can't use a |
9b7168e
to
c7ec843
Compare
@jhawthorn @luukveenis Just removed that last commit that replaced the text_field with a number_field. |
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.
Thanks
Thank you |
Noticed a weird bug when editing a promotion - after updating the promotion, the item total dropped from 1000 down to 1. Looks like the delimiter is causing the amount to get truncated when values are 1000 and over.
Probably due to this:
This removes the delimiter from the
number_with_currency
partial, which is used on the promotion edit page. If there are any other fields that should get a similar treatment, feel free to let me know - happy to make the change.