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

  • Thread starter Thread starter MMJII
  • Start date Start date
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.
 
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.
|
|
 
Back
Top