Surprise price rounding
-
While exporting products from a Jigoshop 1.5.1, the prices were being rounded to the nearest dollar without warning.
This was caused by the calls to get_option(‘jigoshop_price_num_decimals’) at the top of formatting.php returning false, then being cast (int) to zero, then being passed to number_format().
It might be wise to detect the return value of get_option then applying a sensible default if it isn’t found for whatever reason. Ultimately two decimal places is probably a safer default because it won’t matter for those currencies dealing in whole numbers, but may result in pricing mistakes in others (such as in my case).
Cheers for a great plugin!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Surprise price rounding’ is closed to new replies.