I'm having problems with rounding numbers
pls help me out
this is the program instruction that i wrote
x = 420.30 * 0.15
y = 420.30 - x
i print the y out in .2lf format
and it came out as 357.26
it needed it to came out 357.25
i believe that there is a problem with x ( 63.045 ) which is needed to be 63.05
is there a way i could round x ( 63.045 ) before it is minus with 420.30.
Thank you in advance
pls help me out
this is the program instruction that i wrote
x = 420.30 * 0.15
y = 420.30 - x
i print the y out in .2lf format
and it came out as 357.26
it needed it to came out 357.25
i believe that there is a problem with x ( 63.045 ) which is needed to be 63.05
is there a way i could round x ( 63.045 ) before it is minus with 420.30.
Thank you in advance
Comment