Displaying a number with commas 400,000.00
Posted: Mon Apr 14, 2014 4:37 pm
I have a text entry field that needs to be a number.
Here is the code for the entry field.
on keyDown theKey
if theKey is not a number and theKey is not "." then beep
else pass keyDown
end keyDown
I perform a multiplication on this field on exitField and this works fine only allowing numbers and the decimal point to be entered.
If I allow the comma to be entered in the proper locations ie 400,000.00 then the multiplication gives an error as the comma causes the field to not be evaluated as a number.
How can I allow commas and still do a multiplication?
Tom
Here is the code for the entry field.
on keyDown theKey
if theKey is not a number and theKey is not "." then beep
else pass keyDown
end keyDown
I perform a multiplication on this field on exitField and this works fine only allowing numbers and the decimal point to be entered.
If I allow the comma to be entered in the proper locations ie 400,000.00 then the multiplication gives an error as the comma causes the field to not be evaluated as a number.
How can I allow commas and still do a multiplication?
Tom