separator.py

FrontPage|FindPage|TitleIndex|RecentChanges| UserPreferences P RSS
''' all by June ''' #One of the most obvious(and elegant maybe) way (done as TestFirstDesign-way) to do is, def sep(s): p=s.find('.') if p==-1: p=len(s) for i in range(p-3,s[0] in ('+','-'),-3): s=s[:i]+','+s[i:] return s #which can be made to a one-liner using RE as, def sep(s): return re.sub(r"([-+]?\d{1,3}(\.\d*)?)(?=(\d{3})*(\.|$))",r",\1",s)[1:] #or we could simply use the library as, >>> locale.setlocale(locale.LC_ALL,"") 'Korean_Korea.949' >>> locale.format("%s",-12345.3291,1) '-12,345.3291'

"; if (isset($options[timer])) print $menu.$banner."
".$options[timer]->Write()."
"; else print $menu.$banner."
".$timer; ?> # # ?>