Skip to content

Instantly share code, notes, and snippets.

@kkirsanov
Created October 30, 2011 21:14
Show Gist options
  • Save kkirsanov/1326449 to your computer and use it in GitHub Desktop.
Save kkirsanov/1326449 to your computer and use it in GitHub Desktop.
s="12345.123421"
if '.' not in s
s+=".00"
a, b = s.split('.')
cnt=0
tmp=""
for x in reversed(a)
tmp+=x
cnt+=1
if cnt >=3:
tmp+=" "
cnt=0
return reversed(tmp) + "." + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment