sds_distof

int sds_distof (const char *string, int format, sds_real *real);


Convert this value to a real number.


This function converts a given distance (or other quantity), expressed as a string in one of the formats listed below, to a real number expressing the distance in units defined by the LUNITS system variable.

The argument string represents the original number, expressed in one of the formats listed below.

format specifies one of the following formats:

Format Meaning Example
1 Scientific 6.35e1
2 Decimal 63.5
3 Engineering 5'3.5"
4 Architectural 5'3-1/2"
5 Fractional 23-3/4"

The argument real represents the number expressed in units defined by LUNITS.

This function returns RTNORM or an error code.

Example

int format;

sds_real real1;

char string1[512];

format=1;

sds_getstring(1,"\nEnter a number using scientific notation: ",string1);

sds_distof(string1,format,&real1);

sds_printf("\n%s is equal to %f. ",string1,real1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_rtos