Hi, i'm facing an issue with rounding error and i would like to know if there is a way to solve it.
below is an simple example.
[TABLE="width: 490"]
<colgroup><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"><col span="3" style="text-align: center;"></colgroup><tbody>[TR]
[TD="align: center"]quantity[/TD]
[TD="align: center"]a[/TD]
[TD="align: center"]b[/TD]
[TD="align: center"]c[/TD]
[TD="align: center"]d[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]50[/TD]
[TD="align: center"]35%[/TD]
[TD="align: center"]21%[/TD]
[TD="align: center"]16%[/TD]
[TD="align: center"]28%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]using int formula[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]49[/TD]
[/TR]
[TR]
[TD="align: center"]using round formula[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]50[/TD]
[/TR]
</tbody>[/TABLE]
but technically, 18+11+8+14=51
so how can i get exact 50 quantity?
Thanks.
below is an simple example.
[TABLE="width: 490"]
<colgroup><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"><col span="3" style="text-align: center;"></colgroup><tbody>[TR]
[TD="align: center"]quantity[/TD]
[TD="align: center"]a[/TD]
[TD="align: center"]b[/TD]
[TD="align: center"]c[/TD]
[TD="align: center"]d[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]50[/TD]
[TD="align: center"]35%[/TD]
[TD="align: center"]21%[/TD]
[TD="align: center"]16%[/TD]
[TD="align: center"]28%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]using int formula[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]49[/TD]
[/TR]
[TR]
[TD="align: center"]using round formula[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]50[/TD]
[/TR]
</tbody>[/TABLE]
but technically, 18+11+8+14=51
so how can i get exact 50 quantity?
Thanks.