Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - round() round a number to decimal places http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 round()             Round a number to decimal places
------------------------------------------------------------------------------
 Declaration
   math.hdr

 Syntax
   func dbl round extern
   param value dbl eNumber, ;
         value int iPrecision

 Arguments
   eNumber is a numeric expression.
   iPrecision is the number of decimal places.

 Return
   The result of the conversion.

 Description
   The round() function rounds eNumber to the number of decimal places
   indicated by iPrecision.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_round
   set fixed on
   ? round( 23.4, 0 )          // produces   23.00
   ? round( 5323.2333, -2 )    // produces 5300.00
   ? round( 1.999, 2 )         // produces    2.00
   endproc

   proc main
   Test_round()
   endproc

See Also: iround() trunc()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson