Question

i have the product price in decimals,

like 15000.0000

now i want to apply thousand separator on it, intcomma filter works fine with decimals as here

but after it i can't apply currency filter, means it didn't work with currency filter.

i want final output of my Price: PKR 15,000.00

any suggestions to get this?

Thanks :)

Was it helpful?

Solution

The satchmo currency filter requires something that can be converted into a Decimal. However intcomma returns a string, and since it adds the thousand separators, it can no longer be converted to a Decimal.

The solution would be to write a currency_with_intcomma template filter yourself, which first runs through the currency filter and then applies the thousand separators (you can't use the builtin filter for that, you'll have to do it "manullay").

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top