formating

17 views
Skip to first unread message

fabricio mata

unread,
Oct 26, 2013, 6:41:48 AM10/26/13
to django...@googlegroups.com
even through the code {{form.valor_ultimacompra | floatformat: 2}} does not return anything.

my model is

valor_ultimacompra = models.DecimalField (u'Vlr. Ult.Compra 'max_digits = 18, decimal_places = 2, default = 0, blank = True, null = True)


when you step this way}} {{form.valor_ultimacompra works


can someone ajuadar me?

Leonardo Giordani

unread,
Oct 28, 2013, 3:23:52 AM10/28/13
to django...@googlegroups.com
I think that the extra space between "floatformat:" and "2" is confusing the template system. Try using "floatformat:2" without spaces.

Leo

Leonardo Giordani
Author of The Digital Cat
My profile on About.me - My GitHub page - My Coderwall profile


2013/10/26 fabricio mata <pont...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/abddc39f-4379-4ecf-88bc-c178d895ea50%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

fabricio

unread,
Oct 28, 2013, 6:53:52 AM10/28/13
to django...@googlegroups.com

does not work

Leonardo Giordani

unread,
Oct 28, 2013, 8:17:56 AM10/28/13
to django...@googlegroups.com
Can you please paste the code with a good formatting? To pastebin or similar?
I'd like to see model, view and template.


Leonardo Giordani
Author of The Digital Cat
My profile on About.me - My GitHub page - My Coderwall profile


2013/10/28 fabricio <pont...@gmail.com>

does not work

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

fabricio

unread,
Oct 28, 2013, 8:49:48 AM10/28/13
to django...@googlegroups.com

no meu modelo
valor_ultimacompra = models.DecimalField(u'Vlr.Ult.Compra', max_digits=18, decimal_places=2, default=0, blank=True, null=True)


no template
{% extends "base.html" %}
{% load humanize %}
{% load foundation %}


<div class="large-4 columns" >
{{form.valor_ultimacompra|foundation| floatformat:2 }}
</div>



Leonardo Giordani

unread,
Oct 28, 2013, 9:17:39 AM10/28/13
to django...@googlegroups.com
What is foundation?
You said that

{{form.valor_ultimacompra}}

works. What about

{{form.valor_ultimacompra|foundation}}

?


Leonardo Giordani
Author of The Digital Cat
My profile on About.me - My GitHub page - My Coderwall profile


2013/10/28 fabricio <pont...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

fabricio mata de castro Mata

unread,
Oct 28, 2013, 9:27:13 AM10/28/13
to django...@googlegroups.com
the problem is that Form.valor_ultimacompra | tag this bringing all the input

if you Form.valor_ultimacompra.value works but then I lose the input

would make automatic?




{{Form.valor_ultimacompra | floatformat: 2}}


2013/10/28 Leonardo Giordani <giordani...@gmail.com>
Reply all
Reply to author
Forward
0 new messages