Name

atof, atod, dtoi — Convert between strings and numeric types

Synopsis

atof( in arg string);
 
atod( in arg string);
 
dtoi( in arg double precision);
 

Description

atof returns its argument as a single precision floating point. If the string cannot be parsed and converted to a valid float, a value 0.0 is returned.

atod behaves identically to atof except that it returns a double precision (IEEE 64-bit) floating point value. Use this when full double precision is required.

dtoi converts a double precision floating point value to an integer, truncating the fractional part. The result is an integer box that can be either a 32-bit or 64-bit integer depending on the magnitude of the value.

Parameters

arg

A string input parameter

Return Types

Single precision floating point

Examples

Example 24.17. Simple examples

SQL> select atof('1.23456789');
callret
REAL
_______________________________________________________________________________

1.234568

1 Rows. -- 5 msec.

SQL> select atof ('Cadena de los patos amarillos');
callret
REAL
_______________________________________________________________________________

0.000000

1 Rows. -- 4 msec.

SQL> select atof (sprintf ('%f', 2.3423));
callret
REAL
_______________________________________________________________________________

2.342300

1 Rows. -- 5 msec.
      

See Also

atoi


© 1992 - OpenLink Software. All rights reserved.

Making Technology Work for You®