HTML Utilities

Showing help on 'tofloat()'

Syntax: tofloat (value) => FLOAT

Converts the given MOO value into a floating-point number and returns that number. Integers and objects numbers are converted into the corresponding integral floating-point numbers. Strings are parsed as the decimal encoding of a real number which is then represented as closely as possible as a floating-point number. Errors are first converted to integers as in `toint()' and then converted as integers are. `Tofloat()' raises E_TYPE if <value> is a LIST. If <value> is a string but the string does not contain a syntactically-correct number, then `tofloat()' raises E_INVARG.

tofloat(34) => 34.0
tofloat(#34) => 34.0
tofloat("34") => 34.0
tofloat("34.7") => 34.7
tofloat(E_TYPE) => 1.0



-- telnet://project-mongoose.net:7777 -- Mail us -- http://project-mongoose.net:7780/ --
-- Five users connected --