mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
get_billable_amount round down to nearest penny.
This commit is contained in:
committed by
Neil Williams
parent
61e4e4a849
commit
9fcf488269
@@ -24,7 +24,7 @@ from __future__ import with_statement
|
||||
|
||||
from collections import defaultdict, OrderedDict, namedtuple
|
||||
from datetime import datetime, timedelta
|
||||
from decimal import Decimal, ROUND_UP
|
||||
from decimal import Decimal, ROUND_DOWN, ROUND_UP
|
||||
import itertools
|
||||
import json
|
||||
import math
|
||||
@@ -971,7 +971,10 @@ def get_billable_amount(camp, impressions):
|
||||
else:
|
||||
# pre-CPM campaigns are charged in full regardless of impressions
|
||||
billable_amount = camp.bid
|
||||
return billable_amount
|
||||
|
||||
billable_amount = Decimal(billable_amount).quantize(Decimal('.01'),
|
||||
rounding=ROUND_DOWN)
|
||||
return float(billable_amount)
|
||||
|
||||
|
||||
def get_spent_amount(campaign):
|
||||
|
||||
Reference in New Issue
Block a user