Use split to get dollars and cents
This commit is contained in:
parent
ba75466556
commit
cf13ff9104
@ -21,12 +21,12 @@ def dollars(value):
|
|||||||
|
|
||||||
def justDollars(value):
|
def justDollars(value):
|
||||||
raw = dollars(value)
|
raw = dollars(value)
|
||||||
return raw[:-3]
|
return raw.split(".")[0]
|
||||||
|
|
||||||
|
|
||||||
def justCents(value):
|
def justCents(value):
|
||||||
raw = dollars(value)
|
raw = dollars(value)
|
||||||
return raw[-3:]
|
return raw.split(".")[1]
|
||||||
|
|
||||||
|
|
||||||
def usPhone(number):
|
def usPhone(number):
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
{{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | justDollars }}
|
{{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | justDollars }}
|
||||||
</span>
|
</span>
|
||||||
<span class='cents'>
|
<span class='cents'>
|
||||||
{{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | justCents }}
|
.{{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | justCents }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user