How to use unlocalize in views

45 views
Skip to first unread message

julio....@m2agro.com.br

unread,
May 25, 2015, 9:04:06 AM5/25/15
to django...@googlegroups.com
Hello guys!

Is there a way to use unlocalize in views? I know that I can use this in template (https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize)

Luis Zárate

unread,
May 25, 2015, 10:53:50 AM5/25/15
to django...@googlegroups.com
Set in yours Settings

USE_I18N = False

USE_L10N = False

See:
https://docs.djangoproject.com/en/1.8/ref/settings/#use-i18n

2015-05-25 7:01 GMT-06:00 <julio....@m2agro.com.br>:
Hello guys!

Is there a way to use unlocalize in views? I know that I can use this in template (https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize)

--
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/767e0d4e-9671-4363-a09c-1e67839994cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


julio....@m2agro.com.br

unread,
May 25, 2015, 1:30:26 PM5/25/15
to django...@googlegroups.com
Thank You Luis, but it will be for the entire project, right? I just want to apply this to a single variable.

For example,

(float)
variable_x = 15.123  # Thousand separator from my L10N

variable_y = unlocalize(variable_x) 
print variable_y  # 15123

Do you know how can I do that without using a global directive?
Reply all
Reply to author
Forward
0 new messages