User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
651
Parameters The precision eld is a non-negative number that species a number of characters to print, number
of signicant digits or number of decimal places. The precision eld can cause truncation or rounding
of the output value in the case of a oating-point number as specied in the following table.
The optional characters l or L may immediately precede conversion_type to respectively specify
long versions of the integer types d, i, u, o, x, and X.
You must ensure that the argument type matches that of the format specication. You can use type
casts to ensure that the proper type is passed to sprintf.
ags
Meaning of the precision eld
d, u, o, x, X
The precision eld is where you specify the minimum number of digits that will
be included in the output value. Digits are not truncated if the number of digits
in an argument exceeds that dened in the precision eld. If the number of
digits in the argument is less than the precision eld, the output value is padded
on the left with zeros.
f
The precision eld is where you specify the number of digits to the right of the
decimal point. The last digit is rounded.
e, E
The precision eld is where you specify the number of digits to the right of the
decimal point. The last digit is rounded.
g
The precision eld is where you specify the maximum number of signicant
digits in the output value.
c, C
The precision eld has no effect on these eld types.
s
The precision eld is where you specify the maximum number of characters in
the output value. Excess characters are not output.
sprintl
Prototype
void sprintl(char *wh, const code char *f,...);
Returns The function returns the number of characters actually written to destination string.
Description The same as sprintf, except it doesn’t support oat-type numbers.
sprinti
Prototype
void sprinti(char *wh, const code char *f,...);
Returns The function returns the number of characters actually written to destination string.
Description The same as sprintf, except it doesn’t support long integers and oat-type numbers.