Merge pull request #6082 from netchampfaris/int-control-fix
fix(Int control): Skip evaluating numbers with commas
This commit is contained in:
commit
9136df623e
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,11 @@ frappe.ui.form.ControlInt = frappe.ui.form.ControlData.extend({
|
|||
});
|
||||
},
|
||||
eval_expression: function(value) {
|
||||
if (typeof value==='string' && value.match(/^[0-9+-/* ]+$/)) {
|
||||
if (typeof value==='string'
|
||||
&& value.match(/^[0-9+-/* ]+$/)
|
||||
// strings with commas are evaluated incorrectly
|
||||
// for e.g 47,186.00 -> 186
|
||||
&& !value.includes(',')) {
|
||||
try {
|
||||
return eval(value);
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue