It was my understanding that Miva uses bankers rounding, where numbers ending in 5 will round to the nearest even number. So, 0.125 rounds to 0.12 and 0.135 rounds to 0.14. However, I am not getting those rounding results.
Resulting output is consistent with bankers rounding:
$109.25 x .18 = 19.665
19.665 rounded is 19.66
Resulting output is not consistent with bankers rounding (or at least not my understanding of it):
$84.75 x .18 = 15.255
15.255 rounded is 15.25
Is my understanding of Miva's rounding system incorrect? This makes it seem like numbers ending in 5 just round down?
Code:
<mvt:assign name="g.discount_raw" value="109.25* .18" /> <mvt:assign name="g.discount_rounded" value="rnd(g.discount_raw,2)" /> <p> $109.25 x .18 = &mvt:global:discount_raw; <br> &mvt:global:discount_raw rounded is &mvt:global:discount_rounded; </p>
$109.25 x .18 = 19.665
19.665 rounded is 19.66
Code:
<mvt:assign name="g.discount_raw" value="84.75 * .18" /> <mvt:assign name="g.discount_rounded" value="rnd(g.discount_raw,2)" /> <p> $84.75 x .18 = &mvt:global:discount_raw; <br> &mvt:global:discount_raw rounded is &mvt:global:discount_rounded; </p>
$84.75 x .18 = 15.255
15.255 rounded is 15.25
Is my understanding of Miva's rounding system incorrect? This makes it seem like numbers ending in 5 just round down?
Comment