|
Convert an unsigned long to a string. Convert an unsigned long to ASCII for printf purposes, returning a pointer to the first character of the string representation. Octal numbers can be forced to have a leading zero; hex numbers can be printed in upper or lower case. The mode controls various mode for the conversion:
- ULTOA_OCT_ZERO
- When set, a leading 0 is added for non-zero values for the octal conversions.
- ULTOA_UPPER
- When set, upper characters are used (hexadecimal conversions)
- ULTOA_GROUP
- The decimal conversion is made using groups of digits. The function takes two additional parameters:
char thousep An additional character specifies the group separator. const char* grp Specifies the groups in terms of digits.
A
- Parameters:
-
val |
Value to translate into a string |
endp |
Pointer to end of buffer |
base |
Base number for conversion (8, 10 or 16) |
mode |
Control modes |
thousep |
Optional character for thousand separator |
grp |
Group string control |
- Returns:
-
the beginning of the string representation
|