User manual
736
mikoC PRO for dsPIC
MikroElektronika
Parameters The precision eld is a non-negative number that species a number of characters to print, number
of signicant 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 specied 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 specication. 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 dened 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 signicant
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.