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

 Syntax
   func dbl val extern
   param const char cString

 Arguments
   cString is the string to convert.

 Return
   A numeric representation of the input string.

 Description
   The val() function converts cString to a double-precision number.
   Use the val() function if it is necessary to have great precision. For
   general use, and for speed increase, use the ival() function.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_val
   ? val( "99.1234" )         // Result:   99.1234
   ? val( "99A12" )           // Result:   99
   ? val( "B52" )             // Result:    0
   ? val( "" )                // Result:    0
   ? val( space( 1 ) )        // Result:    0
   ? val( " 96.54" )          // Result:   96.54
   ? val( "96 .54" )          // Result:   96
   endproc

   proc main
   Test_val()
   endproc

See Also: ival() str()

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