Previous | Next | (P-PDF) JavaScript
Topic: Rounding off to the nearest decimal point
Conf: (P-PDF) JavaScript, Msg: 28518
From: aandi
Date: 10/13/2001 06:39 PM
One technique, which works in many programming languages is to find if there is a "round to the nearest integer" function or method. If there is the task is almost done: multiply your number by 100, round to the nearest integer, then divide by 100... job done!
However, if you are dealing with currency, be aware of the upper limit on values this implies (perhaps $10 million).