woocommerce / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
20 stars 23 forks source link

Error when using a non standrad decimal amount for a currency #252

Open ChristianAF opened 1 year ago

ChristianAF commented 1 year ago

Describe the bug https://wordpress.org/support/topic/error-when-4-digits-are-used-instead-of-2/

In this case, the user is using "Number of decimals" = 4 for EUR and showing 2 decimals on Front End

To Reproduce Steps to reproduce the behavior:

  1. Set 4 decimals for EUR or USD
  2. Go to the site and add the product to the cart
  3. go to the cart and open the console of the browser
  4. See the error

Screenshots image

Expected behavior No console error should be displayed, the decimals should be truncated to the default for each currency

Isolating the problem (mark completed items with an [x]):