mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
RenderableCampaign: wait to convert bid and spent floats to strings.
Comparing the string values can give incorrect result when checking if a campaign is underdelivered.
This commit is contained in:
@@ -189,8 +189,8 @@ class RenderableCampaign():
|
||||
self.start_date = start_date
|
||||
self.end_date = end_date
|
||||
self.duration = duration
|
||||
self.bid = bid
|
||||
self.spent = spent
|
||||
self.bid = "%.2f" % bid
|
||||
self.spent = "%.2f" % spent
|
||||
self.cpm = cpm
|
||||
self.sr = sr
|
||||
self.status = status
|
||||
@@ -210,8 +210,8 @@ class RenderableCampaign():
|
||||
ndays = camp.ndays
|
||||
duration = strings.time_label % dict(num=ndays,
|
||||
time=ungettext("day", "days", ndays))
|
||||
bid = "%.2f" % camp.bid
|
||||
spent = "%.2f" % get_spent_amount(camp)
|
||||
bid = camp.bid
|
||||
spent = get_spent_amount(camp)
|
||||
cpm = getattr(camp, 'cpm', g.cpm_selfserve.pennies)
|
||||
sr = camp.sr_name
|
||||
live = camp._id in live_campaigns
|
||||
|
||||
Reference in New Issue
Block a user