Atodbl
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
double atodbl(char s[]);
Function
The function converts the string s into a double number. Normally, the base is decimal and must have the following format: [Blank space] [Sign] [Digits] [.Digits] [ {d | D | e | E}[Sign]Digits] String parsing ceases at the first non-compliant character. If the string cannot be converted into a number, 0.0 is returned. If the string starts with 0x, the base used is 16. Only integer numbers can be read in.
Parameters
Input string to be converted.
Return Values
Double number, the converted string.
Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test.
double d;
d = atodbl(" -3.7"); // -3.7
d = atodbl("0x1F"); // 31.0
d = atodbl("1.3E2"); // 130.0
Related APIs
atol | strtod