Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » atodbl

atodbl

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

double atodbl(char s[]);

Description

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] [ [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.

Example

double d;
d = atodbl(" -3.7");     // -3.7
d = atodbl("0x1F");      // 31.0
d = atodbl("1.3E2");     // 130.0
atolstrtod