• Resolved Felty

    (@felty)


    I am doing a calculation based on the price of an item $bonus = $original_price / $some_value and sometimes it rounds odd like $1.0563454

    I could simply round it, but I realized that digital currencies have more than 2 decimal places so rounding to $1.06 may not always be appropriate.

    And sometimes users set the currency to round to whole number as well…

    So is there a way to determine the WooCommerce current decimal setting?

    I’d like avoid having to put it as an option a second time in my plugin.

    Thanks!

    -Felty

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘API Question: Programatically find how many decimal places in currency’ is closed to new replies.