~davidc3/onehundredscopes/calculator-raring

« back to all changes in this revision

Viewing changes to src/unity-scope-calculator

  • Committer: David Callé
  • Date: 2011-11-22 08:25:33 UTC
  • Revision ID: davidc@framli.eu-20111122082533-w4ni0n28cobv43tw
Currency conversion: round to 4 digits after the decimal point

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                        print "Currency conversion mode"
62
62
                        search = search.upper()
63
63
                        mode = 0
 
64
                        #FIXME I CAN HAZ ICON PLZ
 
65
                        icon = "http://tanghus.files.wordpress.com/2009/10/currency-converter-128.png"
64
66
                else:
65
67
                        mode = 1
66
68
                        search = search.replace(' ','')
84
86
                calc_result = calc_result.split('\n')[-1]
85
87
                if mode == 0:
86
88
                        calc_result = calc_result.replace(",", ".")
87
 
                        calc_result = round(float(calc_result),2)
 
89
                        calc_result = round(float(calc_result),4)
88
90
                        calc_result =str(calc_result)
89
91
                print "Result: %s" % calc_result
90
92
                if search: