Rounding total if price is 33.33

Hi all,
If i have an item selling 3 quantities for 100 for sure I need to set the price per item as 33.33
But the total will be 99.99 and not rounded!

How to round?

use Math.ceil(), i.e:

var total = Math.ceil(frm.doc.price1 + frm.doc.price2 + frm.doc.price3);

This will round off to the upper bound or ceiling value

Hi thanks for the reply.
But this happens if you do a Sales Invoice or Quotation and no custom scripts created… My point here is that the System is not doing the round of seeing that that result is 99.99

If the rate is set to 33.33, pricing three for 99.99 is indeed correct.

It sounds like you actually want the unit rate to be 33.333. You can customize the Sales Invoice Item doctype to give higher precision to the rate field. Then, if you set the rate to 33.333, one will sell for 33.33, two will sell for 66.67, and three will sell for 100.00.

Hi, thanks for the reply.
But if you go to System Settings

You would have no reason to customize the Doctypes… But after using the System Settings you still get the 99.999

Your solution is OK for a single Customers or Site but if you have many sites with same rounding you will have to Customize for all instead of just using the Systems Settings.

This is on Version v12.23.0 do not know if is the same on V13.

Right, that’s as intended. If you set all currency values to three digits precision, 33.333 x 3 will equal 99.999.

If you want items to have three digits precision but everything else two, you need to do it via doctype customization, not system settings.