Wires in the money class.
[retire.git] / tax_brackets.py
index c64cf2b842086b51bc1259c25852997c31663960..e0a46607fcfa8e524945acc7d98f03c393c003c6 100644 (file)
@@ -1,4 +1,5 @@
 import utils
+from money import money
 
 class tax_brackets:
     """A class to represent tax brackets and some operations on them."""
@@ -8,7 +9,7 @@ class tax_brackets:
 
     def compute_taxes_for_income(self, income):
         """Compute the tax bill for income given our brackets."""
-        taxes_due = 0
+        taxes_due = money(0)
         while income > 1:
             (threshold, rate) = self.get_bracket_for_income(income)
             taxes_due += (income - threshold) * rate
@@ -71,5 +72,4 @@ class tax_brackets:
     def dump(self):
         """Print out the tax brackets we're using in here."""
         for x in self.brackets:
-            print "{:<20} -> {:<3}".format(utils.format_money(x[0]),
-                                           utils.format_rate(x[1]))
+            print "{:<20} -> {:<3}".format(x[0], utils.format_rate(x[1]))