.49 rounds to 0
.5 rounds to 1
Type: Posts; User: Norm
.49 rounds to 0
.5 rounds to 1
If you want the rounding rules for .4 to round to it 1 then that is your business.
What value would truncate to 0?
Just add .5 to it and use normal rounding.
Normally .4 truncates to 0.
What are your rounding rules?
.304 does not round to .31. Less than .305 should truncate to .3
You would have to add .005 to get it to round up
What is the unformatted value of total?
What variable's contents is being printed?
What is the unformatted value of that variable?
Your weakly formatted code is hard to read. The code within methods should be indented to make it...
Can you copy and paste here your program's output. No images because you can not copy and paste from an image.
and post what you want the output to look like.