Re: Quick help needed: how to format an integer ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Quick help needed: how to format an integer ?

From: Diez B. Roggisch <deets@nospam.web.de>
Date: Wed Oct 05 2005 - 12:37:50 CEST

durumdara@mailpont.hu wrote:
> Hi !
>
> I need to convert some integer values.
>
> "1622" ->"1 622"
>
> or
>
> "10001234" -> ""10.001.234""
>
> So I need thousand separators.
>
> Can anyone helps me with a simply solution (like %xxx) ?

The module locale does what you need, look at ist docs, especially

locale.str
locale.format

Regards,

Diez
Received on Sat Oct 15 04:09:54 2005