PDA

Click to See Complete Forum and Search --> : Number Computation & Decimal Display


vincentg
Sep 14th, 2005, 04:02 PM
Hi,

I dont know if you encounter such problems like this...
Example you need to compute 200/17.28 then the
exact answer will be 11.574074074074074074074074074074

It will be user friendly to display it in with only 2 decimal or 4 decimal numbers lets say in a textbox or something.

But converting it back, it wont longer gave you the correct answer with only 2 decimal or 4 decimal numbers.

11.57 x 17.28 = 199.9296
11.5740 x 17.28 = 199.99872

If using rounded off solution, it wont give an exact answer.

Any insights or comments pertaining to this will be appreciated. Thanks.

- Vince™

RobDog888
Sep 14th, 2005, 04:09 PM
You can store the exact number in a variable but display the rounded shorter number. Then when you need to reverse it back you have the variables value intact to compare against. :)