Hi any one
I have problem when I use printf command.
My Example :
long My_var;
.
.
printf("Sample = \%1.2f",My_var);
.
.
when the value in My_var below 1,assume that it was 0.96
The printf will show .96
Why not 0.96?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514522
Kenny
Joined: 07 Sep 2003 Posts: 173 Location: Australia
Re: printf problem
Posted: Sat May 17, 2003 4:43 pm
:=Hi any one
:= I have problem when I use printf command.
:=My Example :
:=
:=long My_var;
:=.
:=.
:=printf("Sample = \%1.2f",My_var);
:=.
:=.
:=when the value in My_var below 1,assume that it was 0.96
:=The printf will show .96
:=Why not 0.96?
Probably because you declared My_Var as a long instead of float.
f is for float variables in the printf statement.
Regards
Kenny
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514527
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum