User manual

Table Of Contents
636
mikoC PRO for PIC32
MikroElektronika
LongIntToStrWithZeros
Prototype
void LongIntToStrWithZeros(long input, char *output);
Description Converts input signed long integer number to a string. The output string has xed width of 12 characters
including null character at the end (string termination).
The output string is right justied and the remaining positions on the left (if any) are lled with zeros.
Parameters - input: signed long number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 12 characters in length.
Example
int j = -12345678;
char txt[12];
...
LongIntToStrWithZeros(j, txt); // txt is “-0012345678” (one zero here)
Notes None.
ByteToHex
Prototype
void ByteToHex(char input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 3 characters including null character at the end (string termination).
Parameters - input: byte to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 3 characters in length.
Example
unsigned short t = 2;
char txt[3];
...
ByteToHex(t, txt); // txt is “02”
Notes None.