While doing a simple addition, I get an error “Invalid number in parameter ‘grossAmount’.”
I just add 2 numbers, if I use only one without addition it works - so the module understands the number format.
To figure out what’s going wrong, you could check what kind of data you’re working with right before you try to add the numbers together. This helps see if the issue is about whether the computer is seeing your inputs as numbers or text, or if there’s some other formatting mix-up. When I’m coding and run into these kinds of problems, I make sure to change any text into numbers on purpose, using commands like parseInt() or parseFloat() if I’m using JavaScript. This way, I know for sure the computer understands I’m working with numbers, which usually fixes these kinds of errors.
Well it is a number, or am I missing something? And if I use only one of the fields, it works fine. So the system sees it as a number, or not?
But yes, it works with parseNumber. Even if I dont understand why. Thanks for your help!
Maybe the other variable, total
, is text and not a number?
No, its both numbers.