Skip to content

Commit

Permalink
netteForms: converts float & int to numbers [Closes #313]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 17, 2024
1 parent 0c10ca6 commit 890cebc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/assets/netteForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,17 @@
},

integer: function(elem, arg, val) {
return (/^-?[0-9]+$/).test(val);
if ((/^-?[0-9]+$/).test(val)) {
value.value = parseFloat(val);

This comment has been minimized.

Copy link
@forgie1

forgie1 Feb 24, 2024

there is no value variable

This comment has been minimized.

Copy link
@dg

dg Feb 25, 2024

Author Member

fixed

return true;
}
return false;
},

'float': function(elem, arg, val, value) {
val = val.replace(/ +/g, '').replace(/,/g, '.');
if ((/^-?[0-9]*\.?[0-9]+$/).test(val)) {
value.value = val;
value.value = parseFloat(val);
return true;
}
return false;
Expand Down

0 comments on commit 890cebc

Please sign in to comment.