User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
635
IntToStrWithZeros
Prototype
void IntToStrWithZeros(int input, char *output);
Description Converts input integer to a string. The output string has xed width of 7 characters including null
character at the end (string termination).
The output string is right justied and remaining positions on the left (if any) are lled with zeros.
Parameters - input: integer number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 7 characters in length.
Example
short t = -3276;
char txt[7];
...
IntToStrWithZeros(t, txt); // txt is “-03276” (one zero here)
Notes None.
LongWordToStrWithZeros
Prototype
void LongWordToStrWithZeros(unsigned long input, char *output);
Description Converts input longword to a string. The output string has xed width of 11 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: unsigned long number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 11 characters in length.
Example
unsigned t = 12345678;
char txt[11];
...
LongWordToStrWithZeros(t, txt); // txt is “0012345678” (two zeros)
Notes None.