WoW:API tonumber: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
x = tonumber("123") + 25
<center>'''tonumber()''' ''-Documentation by [[user:Two|Two]]-''</center>
----
;''Arguments''
:<b>tonumber(text)</b>
::<b>text</b> <i>(string)</i> - this value will be converted to a numeric value.


the result x is 148
----
;''Returns''


:: The argument as a numeric value or <b>nil</b> if the value cannot be converted.
----
;''Examples''
tonumber("123") 
--Returns 123
tonumber("argqerg") 
--Returns nil
----
{{Template:WoW API}}
[[Category:API Functions|tonumber]]
[[Category:API Functions|tonumber]]
[[Category:API String Functions|tonumber]]
[[Category:API String Functions|tonumber]]

Revision as of 14:35, 28 August 2005

tonumber() -Documentation by Two-

Arguments
tonumber(text)
text (string) - this value will be converted to a numeric value.

Returns
The argument as a numeric value or nil if the value cannot be converted.

Examples
tonumber("123")  
--Returns 123
tonumber("argqerg")  
--Returns nil

Template:WoW API