Skip to content

Commit

Permalink
Dollar amounts as floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin committed Dec 12, 2012
1 parent 56fc386 commit c7e55fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ec2costs.py
Expand Up @@ -48,9 +48,9 @@ def get_current_ondemand_costs():
for size in instance["sizes"]:
for values in size["valueColumns"]:
if values["name"] == "linux":
linux_cost = values["prices"]["USD"]
linux_cost = float(values["prices"]["USD"])
elif values["name"] == "mswin":
win_cost = values["prices"]["USD"]
win_cost = float(values["prices"]["USD"])
prices[region_string][ec2_type_map[inst_type] + "." + ec2_size_map[size["size"]]] = {"windows": win_cost, "linux": linux_cost}
except:
print >> sys.stderr, "WARNING: Amazon added a new region or instance type that we don't know about yet."
Expand Down

0 comments on commit c7e55fc

Please sign in to comment.