I need a way to format a numerical feild to display 2 decimal

M

MMJII

Hello
I have a form that a java script performs some calcs and displays the result
in the feilds on the form.
The results in the feild has18 digits.
I need a way to format a numerical feild to display 2 decimal places to the
right on the results webpage.
I have tried suggestions to change the size of the feild on the page, but
you can still scroll to the right in the feild to see all numbers past the
decimal point.
Thanks for any ideas.
 
S

Stefan B Rusynko

JavaScript round only allows you to round to whole integers
Try

x=Math.round(y*100)/100

where y is your value you want to display to 2 places (if it has any place after the decimal)
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hello
| I have a form that a java script performs some calcs and displays the result
| in the feilds on the form.
| The results in the feild has18 digits.
| I need a way to format a numerical feild to display 2 decimal places to the
| right on the results webpage.
| I have tried suggestions to change the size of the feild on the page, but
| you can still scroll to the right in the feild to see all numbers past the
| decimal point.
| Thanks for any ideas.
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top