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 - getsetdecimals() get and set the decimals value http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getsetdecimals()    Get and set the decimals value
------------------------------------------------------------------------------
 Declaration
   getset.hdr

 Syntax
   func int getsetdecimals extern
   param value uint uDecimals

 Arguments
   uDecimals is the new decimals setting.

 Return
   The previous decimals setting.

 Description
   The getsetdecimals() function sets the decimals value and returns its
   previous setting.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_getsetdecimals
   vardef
      uint nPrevious
   enddef
   set fixed on
   ? 1.234567890
   nPrevious := getsetdecimals( 5 )
   ? nPrevious                         // prints 2
   ? 1.234567890
   ? getdecimals()                     // prints 5
   getsetdecimals( nPrevious )
   ? 1.234567890
   ? getdecimals()                     // prints 2
   endproc

   proc main
   Test_getsetdecimals()
   endproc

See Also: getdecimals() setdecimals()

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