2 decimals, always

30 views
Skip to first unread message

Carmelo J. Morales Muñoz

unread,
Jan 19, 2018, 7:55:22 AM1/19/18
to Django users
hello!....

I don´t know how solve this... I need django show always float numbers in this format:

1234.56        

actually use 1 decimal only, example:   1234,1

I need 1234,10

thanks for your help

Kasper Laudrup

unread,
Jan 19, 2018, 8:13:24 AM1/19/18
to django...@googlegroups.com
Hi Carmelo,

On 2018-01-19 13:24, Carmelo J. Morales Muñoz wrote:
> hello!....
>
> I don´t know how solve this... I need django show always float numbers
> in this format:
>
> 1234.56
>
> actually use 1 decimal only, example:   1234,1
>
> I need 1234,10
>

You don't write anything about which context you're talking about, but
assuming you're talking about the Django templating system, you should
have a look at this:

https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#floatformat

Cheers,

Kasper

Carmelo J. Morales Muñoz

unread,
Jan 21, 2018, 4:23:46 PM1/21/18
to Django users
thankd for your help.... its ok.... thanks!...
Reply all
Reply to author
Forward
0 new messages