fnDecStrHex()

unsigned long fnDecStrHex(CHAR *ucNewAdd);

ucNewAdd is a CHAR pointer to an input ASCII decimal value which will be converted to its binary value.

The input string may be terminated by any character below the ASCII '0', making it practical for also converting inputs where each individual numbers are terminated by a dash, or similar character.

White space and other characters should first be removed from the input buffer.

The function returns an unsigned long value containing the extracted value. If negative input values are anticipated, the check for a signed input and following conversion should be performed by the calling function.

Examples

Example of extracting a number from an input string:
CHAR buf[] = "123456";
unsigned long ulResult = fnDecStrHex(buf);

The resulting value is 0x1e240

Related functions

fnHexStrHex();




Please use the µTasker forum to ask specific questions.