How do I cut off decimal places in C without rounding?
For example if the number is 4.48
4.48
it will just show 4.4
4.4
%.1f>
If your compiler supports C99, you should be able to use trunc() and friends:
float f = 4.56f; f = truncf(f * 10.0) / 10.0;