Hello Everyone..
I wrote a function called "totalsales" for a short business program I
wrote, and I can't keep the decimal point aligned in the colums in the
printf output statement. The data comes from an array
sales[4][5], which is passed to the function .
like ---- Tracey John Terry
0.00 10.00 51.00
0.00 12.50 50.00
Usually what it prints is like this:
like ---- Tracey John Terry
100.00 10.00 51.00
0.00 12.50 50.00
I tried simple code like
if (subtototal 10) {
printf("\b");
}
if (subtotal 100) {
printf("\b\b");
}
Sometimes it works, but I can't find how make all the data line up,
cause the data can vary from 2 digits with the decimal point or up to 5
digits with the decimal point.
Does anyone know how to code this?
Thanks for all your help
Neil.
..