How can we round up the tax to 2 decimals, but the last decimal should be either 0 or 5. I have this rule for the round up:
if ($decimal % 10 <= 2) {
// Here, the last decimal should be 0.
}
else if ($decimal%10 > 2 && $decimal%10 <=7) {
// Here, the last decimal should be 5.
}
else {
// Here, the decimal should be incremented by 1, while making the last decimal 0.
}
For examples:
- 10.24, rounds up to 10.25
- 10.67 rounds up to 10.65
- 10.88 rounds up to 10.90
- 10.99 rounds up to 11.00
Can I alter the tax adjustment somewhere? Also, I would like to calculate it on the full order price, not individually for all order items.