User manual

720
mikoC PRO for dsPIC
MikroElektronika
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.
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.