# 22. Virtuoso Functions Guide - atof

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
abs
atof
bit_and
bit_not
bit_or
bit_shift
bit_xor
ceiling
either
equ
exp
floor
isdouble
isfloat
isinteger
isnumeric
iszero
log
log10
lower
mod
power
randomize
rnd
sign
sqrt
trigonometric
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## atof

Convert a string to single precision float
atof (in arg string);
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.

Parameters
arg – A string input parameter
Return Types

Single precision floating point

Examples
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