Difference between revisions of "SHIP:Sail:atod"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|atod}}||{{DataType|Double}}||style="text-align:center;"|5.1.0||Parses a {{DataType|String}} to get a {{DataType|Doub...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|atod}}||{{DataType|Double}}||style="text-align:center;"|5.1.0||Parses a {{DataType|String}} to get a {{DataType|Double}} from it {{v5}}</onlyinclude>
+
|{{SailFunc|atod}}||{{DataType|Double}}||style="text-align:center;"|v5.1.0||Parses a {{DataType|String}} to get a {{DataType|Double}} from it</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==
Line 44: Line 44:
  
 
*try/catch is targeted for introduction in SHIP v5.1 to detect this condition.
 
*try/catch is targeted for introduction in SHIP v5.1 to detect this condition.
 +
 +
[[Category:String Functions]]
 +
[[Category:Numeric Functions]]

Latest revision as of 10:05, 14 October 2016

Function Returns Introduced Description
atod Double v5.1.0 Parses a String to get a Double from it

See Also:

Prototype

Double atod(String string);

Parameters/Return Value

Parameter Data Type Description
string String The string to parse
Return Double the double parsed value of the string

Detailed Description

The atod(string) function returns the Double parsed value of a String which should contain the string version of an Double.

Examples

Example Result Notes
atod("-5"); -5
atod("+5"); +5
atod("5.76"); +5 Parsing stops at the first non-number, in this case the '.'
atod("57X"); +57 Parsing stops at the X
atod("P57X"); 0 An error, parsing stops at the P*
  • try/catch is targeted for introduction in SHIP v5.1 to detect this condition.