From 7ced713e612108b8fc2eb2e22cc3d25054f7447f Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Sun, 13 Nov 2011 13:07:38 +0000 Subject: [PATCH] Tax rate formatting. Closes #192. --- admin/admin-settings-forms.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/admin-settings-forms.php b/admin/admin-settings-forms.php index 7dafcfb8d76..a077c7d383c 100644 --- a/admin/admin-settings-forms.php +++ b/admin/admin-settings-forms.php @@ -35,7 +35,10 @@ function woocommerce_update_options($options) { if (isset($tax_classes[$i]) && isset($tax_countries[$i]) && isset($tax_rate[$i]) && is_numeric($tax_rate[$i])) : - $rate = number_format(woocommerce_clean($tax_rate[$i]), 4); + $rate = esc_attr(trim($tax_rate[$i])); + if ($rate>100) $rate = 100; + $rate = number_format($rate, 4, '.', ''); + $class = woocommerce_clean($tax_classes[$i]); if (isset($tax_shipping[$i]) && $tax_shipping[$i]) $shipping = 'yes'; else $shipping = 'no';