-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-19937 - ensure amount preceded by $ is still treated as a number #9745
Conversation
otherwise the payment fields will not be shown.
This is a good idea but probably should also handle currency symbols that aren't the dollar sign.
|
I'm not sure how to test for any currency symbol... but we could test if the first character is not a number and if so strip it off and test the rest of the string to see if it's a number. |
@@ -150,7 +150,8 @@ function calculateSelectLineItemValue(priceElement) { | |||
*/ | |||
function calculateText(priceElement) { | |||
//CRM-16034 - comma acts as decimal in price set text pricing | |||
var textval = parseFloat(cj(priceElement).val().replace(thousandMarker, '')); | |||
//CRM-19937 - dollar sign easy mistake to make by users. | |||
var textval = parseFloat(cj(priceElement).val().replace(thousandMarker, '').replace('$', '')); |
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.
@jmcclelland I see we already have currency symbol in a symbol
variable as we have for thousandMarker
. We should be able to replace the same using:
.replace(thousandMarker, '').replace(symbol, ''));
Can you please try this and check if it works for you ?
Thanks.
Ah... symbol - didn't see that. Great idea. I just made the change. |
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.
works fine.
Based on the review above and my own reading of the code I think this is good to merge |
CRM-19937 - ensure amount preceded by $ is still treated as a number
otherwise the payment fields will not be shown.