Re: 3 number and dot..



Abandoned <besturk@xxxxxxxxx> writes:

Hi..
I want to do this:
for examle:
12332321 ==> 12.332.321

How can i do?

I'm surprised that no one has proposed a regex solution, such as:

import re
re.sub(r'\d{1,3}(?=(?:\d{3})+$)', r'\g<0>.', str(1234567))
'1.234.567'
.