diff --git a/commerce.module b/commerce.module
index c12721d..e2cd74a 100644
--- a/commerce.module
+++ b/commerce.module
@@ -380,7 +1947,7 @@ function commerce_currency_format($price, $currency_code, $object = NULL) {
   }
 
   // Format the price as a number.
-  $price = number_format(round($price, $currency->decimals), $currency->decimals, $currency->decimal_separator, $currency->thousands_separator);
+  $price = number_format(commerce_currency_rounding($price, $currency->decimals, $currency->rounding), $currency->decimals, $currency->decimal_separator, $currency->thousands_separator);
 
   // Establish the replacement values to format this price for its currency.
   $replacements = array(
@@ -394,3 +1961,27 @@ function commerce_currency_format($price, $currency_code, $object = NULL) {
 
   return t('@code_before @negative@symbol_before@price @symbol_after @code_after', $replacements);
 }
+
+/**
+ * Rounds a price to currency needs.
+ *
+ * Normal rounding will apply for the most currencies, but some e.g.
+ * Swiss Francs have to be rounded to five steps.
+ *
+ * @param integer $price
+ *   The value to round
+ * @param integer $decimals
+ *   Number of decimal digits to round to.
+ * @param integer $base
+ *   Stepsize to round to. Currently only works with 2 and 5
+ *
+ * @return
+ *   The rounded value
+ */
+function commerce_currency_rounding($price, $decimals = 2, $base = 0) {
+  if (!$base) {
+    return round($price, $decimals);
+  }
+  $modifier = 1 / ($base / pow(10, $decimals));
+  return round($price * $modifier) / $modifier;
+}
diff --git a/tests/commerce_base.test b/tests/commerce_base.test
index 025c82e..2e157e8 100644
--- a/tests/commerce_base.test
+++ b/tests/commerce_base.test
@@ -657,4 +656,65 @@ class CommerceBaseTesterTestCase extends CommerceBaseTestCase {
     $this->drupalGet("node/{$product_node->nid}");
     $this->assertText($product_node->title, "Product <em>{$product_node->title}</em> node page exists!");
   }
+
+
+  /**
+   * Test the currency value rounding.
+   */
+  public function testCurrencyRounding() {
+
+    // array( decimals => array( base => array( 'value' => 'expected result')));
+    $rounding_numbers = array(
+      '2' => array(
+        '5' => array(
+          '1' => '1',
+          '5' => '5',
+          '777' => '777',
+          '1.22' => '1.20',
+          '12.2249' => '12.20',
+          '1200.225' => '1200.25',
+          '0.2749' => '0.25',
+          '490.275' => '490.30',
+        ),
+        '2' => array(
+          '1' => '1',
+          '777' => '777',
+          '1.205' => '1.20',
+          '12.20999' => '12.20',
+          '1200.21' => '1200.22',
+          '0.26999' => '0.26',
+          '490.2712' => '490.28',
+        ),
+      ),
+      '1' => array(
+        '5' => array(
+          '1' => '1',
+          '5' => '5',
+          '1.22' => '1',
+          '12.2499' => '12',
+          '1200.25' => '1200.5',
+          '0.749' => '0.5',
+          '490.75' => '491.0',
+        ),
+        '2' => array(
+          '1' => '1',
+          '777' => '777',
+          '1.05' => '1',
+          '12.0999' => '12',
+          '1200.1' => '1200.2',
+          '0.6999' => '0.6',
+          '490.712' => '490.8',
+        ),
+      ),
+    );
+
+    foreach ($rounding_numbers as $decimals => $bases) {
+      foreach ($bases as $base => $numbers) {
+        foreach ($numbers as $input => $output) {
+          $result = commerce_currency_rounding($input, $decimals, $base);
+          $this->assertEqual($result, $output, 'Round ' . $input . ' to ' . $decimals . ' decimals with ' . $base . ' as base results in ' . $output);
+        }
+      }
+    }
+  }
 }
