User manual
mikroC PRO for dsPIC
MikroElektronika
729
Parameters The precision eld is a non-negative number that species the 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 printout.
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.
Returns Nothing.
Requires Nothing.
Example Print mikroElektronika example’s header le to UART.
void PrintHandler(char c){
UART1_Write(c);
}
void main(){
UART1_Init(9600);
Delay_ms(100);