mirumee / django-prices

Django fields for the prices module
158 stars 52 forks source link

Nicer rendering #32

Closed mjtamlyn closed 7 years ago

mjtamlyn commented 8 years ago

I can't see an obvious way to get $5 rendered instead of $5.00 for round numbers. The equivalent of what {{ price|floatformat:"-2" }} would do.

patrys commented 8 years ago

This is interesting since in some contexts having a shorter number may look better (assuming it's common in current locale) but in others may cause confusion.

For example:

Order now and get it as low as $5!

But:

Foo           $123.50
Bar             $5.50
Baz               $50
---------------------
Total:           $179
mjtamlyn commented 8 years ago

Agreed, I don't think it's a change you should have by default, but it's a pretty reasonable one to have a nice API/templatetag/filter/whatever for.

patrys commented 7 years ago

This is now possible with the new API.