Formatting Floating Point Numbers 
Author Message
 Formatting Floating Point Numbers

Is there any way to format a floating  point number using JScript.  Here
is what I'm trying to accomplish:

original number: 574.493858937
formatting: nnn.nn
desired output: 574.49

original number: 7.78548623478e-15
formatting nnn.nn
desired output: 0.00

Any help is much appreciated!

Jason



Sun, 06 Oct 2002 03:00:00 GMT  
 Formatting Floating Point Numbers
http://www.faqts.com/knowledge-base/index.phtml/fid/209/lang/

Quote:

> Is there any way to format a floating  point number using JScript.  Here
> is what I'm trying to accomplish:

> original number: 574.493858937
> formatting: nnn.nn
> desired output: 574.49

> original number: 7.78548623478e-15
> formatting nnn.nn
> desired output: 0.00

> Any help is much appreciated!

> Jason

--

        Martin Honnen
        http://javascript.faqts.com/
        http://home.t-online.de/home/martin.honnen/jsgoddies.html



Mon, 07 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Rounding floating point numbers

2. How to fix a float number to a desired number of floating points...

3. Floating point accelerators for Postscript type laser printers

4. Floating point error in v3.33 cdeskjet device?

5. Rounding floating point value to 2 decimal places

6. Floating point values

7. gs : floating point exception error

8. Floating point maths in postscript

9. 3.51 under Linux: Floating Point Exception

10. LJ4 floating point bug and a work-around for dvips-generated files

11. compute 2 floating-point values

12. To show floating number in ASP grid control

 

 
Powered by phpBB® Forum Software