Value entered does not match the format of the field - HELP
I know there are a million questions about this. I swear I've read them all. They are all nuanced and for a completely illiterate JavaScript person, I'm dumfounded.
I have a form with several division calculations. The first is calculating correctly, when information is put into the fields, but before I get to the calculation in question, every other field I type into gives me the error.
I need to divide two numbers (both whole numbers) and the answer needs to be a percentage. So my first field "A" has no formatting, the second field "B" also has no formatting. The quotient field is formatted as a percentage. Here is my JavaScript formula:
event.value = (this.getField("TenantSqFt").value / this.getField("ProjectSqFt").value);
I read somewhere that calculations don't like formatting. That's great, but when I take away the percentage formatting for the quotient field it gives me a very lengthy decimal. Note that I do not get the error at all when I take the percentage formatting off the quotient field.
So either I'm doing something wrong, or I need to adjust the Java Script formula to adjust for this. I can change the formula for it to appear like a percent by multiplying by 100, but I still get the lengthy decimal:
event.value = ((this.getField("TenantSqFt").value / this.getField("ProjectSqFt").value) * 100);
Ideally my A and B fields would be able to be formatted as numbers (so they can have commas for the thousands place) but if that's a deal breaker I'll have to live with it.
So then the next question becomes, do I need to throw rounding into the mix? And how on earth do I do that??
Thank you fine folks!!
