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 - str() convert number to a formatted string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 str()               Convert number to a formatted string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char str extern
   param value dbl  eNumber, ;
         value uint uStringLength, ;
         value uint uDecimalPlaces

 Arguments
   eNumber is a numeric expression to convert.
   uStringLength is the length of the output string.
   uDecimalPlaces is the number of decimal places in the output string.

 Return
   A string representation of the passed numeric.

 Description
   The str() function converts eNumber into a formatted string. uStringLength
   is the total length of the resultant string including decimal places.
   uDecimalPlaces is the number of decimal digits in the string.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_str
   ? str( 10.234, 5, 2 )       // Prints "    10.23"
   ? str( 55.55, 4, 1 )        // Prints
   
   // For numeric values, use the <nwidth>:<decimal places> syntax when
   // using the ? or ?? commands
   ? str( 643.89, 5, 1 )            // this is identical to
   ? 643.89:5:1                     // this...
   endproc

   proc main
   Test_str()
   endproc

See Also: istr() val()

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