The moose likes HTML, CSS and JavaScript and the fly likes round off 2 decimals Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "round off 2 decimals" Watch "round off 2 decimals" New topic
Author

round off 2 decimals

kesava chaitanya
Ranch Hand

Joined: Aug 15, 2001
Posts: 140
hi

i want to round off upto 2 decimals like this;my textbox maxlangth is 8;
for example

if i give .0000001 it should come as .01
like wise .00002 it should come as .01
like wise .002 it should come as .01
like wise .552525 it should come as .56


can anybody give me any code or links ?? urgent for me

bye
chaitanya
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
You can search the forum and you would come up with this:
http://www.coderanch.com/t/113985/HTML-JavaScript/Rounding-off-amounts

Eric
 
jQuery in Action, 2nd edition
 
subject: round off 2 decimals
 
Threads others viewed
Problem while executing the program
storing money as a double
rounding a fraction+time
cut off decimals of a float number
How do i get the farition
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com