Title: Decimal Precision Error
Last modified: November 27, 2021

---

# Decimal Precision Error

 *  Resolved [steveconnected](https://wordpress.org/support/users/steveconnected/)
 * (@steveconnected)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/decimal-precision-error/)
 * Hi,
    Have a bit of a problem with trying to checkout some items, it looks like
   a decimal issue but only happens on some items! (I’ve posted the error I’m getting
   below).
 * I have 3 item, each item has 2 options (I’m using the options to set postage 
   costs).
    Price is set to £
 * Product 1 is 11.99.
    Option 1 is 5 – FAILS Option 2 is 13.52 – FAILS
 * Product 2 is 19.99.
    Option 1 is 5 – WORKS Option 2 is 13.52 – WORKS
 * Product 3 is 37.99.
    Option 1 is 5 – WORKS Option 2 is 13.52 – FAILS
 * The site is using the WP Twenty Twenty Template with Twentig.
    I’ve tried recreating
   the product that are erroring but that didn’t help. Advanced setting: Currency
   Position left (£1.00) Decimal Separator . Thousand Separator , Number of Decimals
   2
 * Do you have suggestions?
 * **Error I’m getting **
    `{“name”:”UNPROCESSABLE_ENTITY”,”details”:[{“field”:”/
   purchase_units/@reference_id==’default’/amount/breakdown/item_total/value”,”value”:”
   51.510000000000005″,”issue”:”DECIMAL_PRECISION”,”description”:”If the currency
   supports decimals, only two decimal place precision is supported.”}],”message”:”
   The requested action could not be performed, semantically incorrect, or failed
   business validation.”,”debug_id”:”78d561b4f6435″,”links”:[{“href”:”[https://developer.paypal.com/docs/api/orders/v2/#error-DECIMAL_PRECISION&#8221](https://developer.paypal.com/docs/api/orders/v2/#error-DECIMAL_PRECISION&#8221);,”
   rel”:”information_link”,”method”:”GET”}]}

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [mra13 / Team Tips and Tricks HQ](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/decimal-precision-error/#post-15110201)
 * Thank you. We will check it out and give an update.
 *  Thread Starter [steveconnected](https://wordpress.org/support/users/steveconnected/)
 * (@steveconnected)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/decimal-precision-error/#post-15118301)
 * Hi,
    I’ve done a bit more digging and the error is on the json sent to Paypal.
 * I think its this file
    wp-express-checkout\assets\js\public.js (and the min version)
 * line 279 and 289 are outputting a “value” field to the json but its not rounding
   the value to 2 decimal places (as I need).
 * I’ve testing it by using Math.round and it works but I’m aware this won’t be 
   suitable fix as it doesn’t take into account the decimal setting in the plugin
   admin.
 * But I hope this helps tracking down the issue!?
 *  Plugin Author [mra13 / Team Tips and Tricks HQ](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/decimal-precision-error/#post-15133521)
 * This should be fixed in the new version. Please upgrade the plugin when you can.
 *  Thread Starter [steveconnected](https://wordpress.org/support/users/steveconnected/)
 * (@steveconnected)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/decimal-precision-error/#post-15135423)
 * Thats fixed it!
 * Many thanks
    Steve

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Decimal Precision Error’ is closed to new replies.

 * ![](https://ps.w.org/wp-express-checkout/assets/icon-128x128.png?rev=2219181)
 * [WP Express Checkout (Fast Payments via PayPal & Stripe)](https://wordpress.org/plugins/wp-express-checkout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-express-checkout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-express-checkout/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-express-checkout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-express-checkout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-express-checkout/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [steveconnected](https://wordpress.org/support/users/steveconnected/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/decimal-precision-error/#post-15135423)
 * Status: resolved