Editing the pdf invoice

47 views
Skip to first unread message

Shawn Collins

unread,
Apr 27, 2012, 1:54:35 PM4/27/12
to Satchmo users
Hey guys, I love this satchmo program. I'm trying to get the quantity
that shows on the invoice to read just one digit. Looking at the
invoice.rml I found the tag {{ item.quantity }} but I can't figure out
where to edit that tag to make quantities a whole number. Can anyone
point out where to edit this?

Chris Moffitt

unread,
Apr 27, 2012, 3:35:18 PM4/27/12
to satchm...@googlegroups.com
You want to use the normalize_decimal filter to do this.
 
Make sure that the following is at the top of your template:
 
{% load normalize_decimal %}
 
then use it like this:
 
{{ item.quantity|normalize_decimal }}
 
-Chris


--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.


Shawn Collins

unread,
Apr 27, 2012, 3:51:09 PM4/27/12
to Satchmo users
Thank you very much Chris!

On Apr 27, 1:35 pm, Chris Moffitt <ch...@moffitts.net> wrote:
> You want to use the normalize_decimal filter to do this.
>
> Make sure that the following is at the top of your template:
>
> {% load normalize_decimal %}
>
> then use it like this:
>
> {{ item.quantity|normalize_decimal }}
>
> -Chris
>

ma...@cuthemustard.com

unread,
Apr 28, 2012, 11:48:27 AM4/28/12
to satchm...@googlegroups.com
Unless you are using the normalize_decimal tag's rounding customisation, you can also use Django's built-in floatformat
Reply all
Reply to author
Forward
0 new messages