{"id":10880409,"date":"2018-11-14T16:04:14","date_gmt":"2018-11-14T16:04:14","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=10880409"},"modified":"2018-11-14T16:06:08","modified_gmt":"2018-11-14T16:06:08","slug":"tax-calculations-not-rounding-properly","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/tax-calculations-not-rounding-properly\/","title":{"rendered":"Tax Calculations not rounding properly"},"content":{"rendered":"<p>When calculating totals in the cart, something is definitely not rounding correctly. When displaying 2 decimal places, this is the result we are getting:<\/p>\n<p>Subtotal:  $1.99<br \/>\nShipping:  $8.50<br \/>\n5% GST  :  $0.52<br \/>\n7% PST  :  $0.73<br \/>\nTOTAL   :  $11.75<\/p>\n<p>Doing that same transaction with 4 decimal places, it&#8217;s clear that the 5% GST is not rounding properly. It&#8217;s ignoring the last decimal place (or 2)&#8230;<\/p>\n<p>Subtotal:  $1.9900<br \/>\nShipping:  $8.5000<br \/>\n5% GST  :  $0.5245<br \/>\n7% PST  :  $0.7343<br \/>\nTOTAL   :  $11.7488<\/p>\n<p>Has anyone else come across this?  (and hopefully come up with a fix?)<\/p>\n","protected":false},"template":"","class_list":["post-10880409","topic","type-topic","status-publish","hentry","topic-tag-cart","topic-tag-rounding","topic-tag-tax"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10880409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10880409\/revisions"}],"predecessor-version":[{"id":10880416,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10880409\/revisions\/10880416"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10880409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}