~djgoldsmith/+junk/energytracker

« back to all changes in this revision

Viewing changes to energytracker/views/review.py

  • Committer: djgoldsmith at googlemail
  • Date: 2013-08-12 14:26:46 UTC
  • Revision ID: djgoldsmith@googlemail.com-20130812142646-czypzn6y6zfas0f3
Added daily use to gas cost

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    #and the cost 
113
113
    stdcharge = (totaldays * GAS_STD_CHARGE) 
114
114
    unitcosts = total_kwh * GAS_PER_UNIT
115
 
    totalcosts = stdcharge + unitcosts
 
115
    totalcosts = (stdcharge + unitcosts) / 100.0
116
116
    outdict["total_cost"] = "{0:.2f}".format(totalcosts)
117
117
 
118
118
    #Simply do average based on total / time
216
216
        #And Convert to money
217
217
        totalcost = ((GAS_STD_CHARGE*7.0) + (kwhuse * GAS_PER_UNIT)) / 100.0
218
218
        coststr = "{0:.2f}".format(totalcost)
 
219
        daycost = "{0:.2f}".format(totalcost/7.0)
219
220
        log.debug("Total Cost {0}".format(totalcost))
220
221
        
221
 
        uselist.append([datestr, kwhstr, coststr])
 
222
        uselist.append([datestr, kwhstr, coststr,daycost])
222
223
 
223
224
    #Reduce to the last 4 weeks
224
225
    if len(uselist) > 4: