You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
The "round" filter (Round.java) uses the default rounding in DecimalFormat.class which is HALF_EVEN.
I believe that HALF_UP may be the correct, but I have no data/reference to back this up. HALF_UP rounds all numbers up when the decimal is higher or equal to .5, whereas HALF_EVEN rounds to the nearest neighbour (as do HALF_UP), but when equal distance to the neighbour, it rounds to the value that is even. So 10.5 becomes 10, and 11.5 becomes 12.
At least in Denmark the default rounding is always to round upwards when reached .5 in decimal.
The text was updated successfully, but these errors were encountered:
Actually I just created a temporary Shopify shop and made a template that uses {{ 10.5 | round }} .
The final result is: 11, so Shopify rounds HALF_UP.
Hi.
The "round" filter (
Round.java
) uses the default rounding inDecimalFormat.class
which isHALF_EVEN
.I believe that
HALF_UP
may be the correct, but I have no data/reference to back this up.HALF_UP
rounds all numbers up when the decimal is higher or equal to.5
, whereasHALF_EVEN
rounds to the nearest neighbour (as doHALF_UP
), but when equal distance to the neighbour, it rounds to the value that is even. So 10.5 becomes 10, and 11.5 becomes 12.At least in Denmark the default rounding is always to round upwards when reached .5 in decimal.
The text was updated successfully, but these errors were encountered: