Forum Discussion
How to display 2-decimal places in variable calculations?
Hi Norah,
You had a few errors in your file. A corrected version is attached.
First, you were executing the JavaScript right away but it needs to be executed whenever NumericEntry changes.
Next, you were using a numeric entry field. I assume you don't want the user to type a value in that box but that's the way it was working. I removed the numeric entry field.
The variable you created in your project, "txtvalue" (lowercase v), did not match the case of the variable in JavaScript, "txtValue" (uppercase V).
Your project did not display the txtValue variable, which is the variable that contains the correctly formatted number. I put that variable in a box on the screen where you had the numeric entry field.
Seems to work OK now but take a look and let me know if you were looking for something different.