Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43576 > unrolled thread
| Started by | Mitya Sirenef <msirenef@lightbird.net> |
|---|---|
| First post | 2013-04-14 15:16 -0400 |
| Last post | 2013-04-14 15:16 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: howto remove the thousand separator Mitya Sirenef <msirenef@lightbird.net> - 2013-04-14 15:16 -0400
| From | Mitya Sirenef <msirenef@lightbird.net> |
|---|---|
| Date | 2013-04-14 15:16 -0400 |
| Subject | Re: howto remove the thousand separator |
| Message-ID | <mailman.597.1365967017.3114.python-list@python.org> |
On 04/14/2013 02:57 PM, pyth0n3r wrote:
> Hi,
> I came across a problem that when i deal with int data with ',' as
thousand separator, such as 12,916, i can not change it into int() or
float().
> How can i remove the comma in int data?
> Any reply will be appreciated!!
>
> Best,
> Chen
>
>
>
I would do int(num.replace(',', ''))
-m
--
Lark's Tongue Guide to Python: http://lightbird.net/larks/
When a friend succeeds, I die a little. Gore Vidal
Back to top | Article view | comp.lang.python
csiph-web