cwbe coordinatez:
101
63540
2076399
856608
3409436

ABSOLUT
KYBERIA
permissions
you: r,
system: public
net: yes

neurons

stats|by_visit|by_K
source
tiamat
commanders
polls

total descendants::
total children::0
1 ❤️


show[ 2 | 3] flat


Chcel by som si spravit funkciu na lubovolne formatovanie. Light verziu si predstavujem si to takto nejak:

num = 12345.6789
\>\>\> print f(num,10,3)
 12345.679

\>\>\> print f(num,-8,2)
12345.68


Ale uplne idealne by bolo, keby to umoznovalo aj rozne druhy formatov - napriklad
f(num,10,3,'e') by vratilo '%10.3e' % num (1.235e+004),
zatialco
f(num,10,3,'g') by vratilo '%10.3g' % num ( 1.23e+004).

Je nieco take mozne?

------------
jupii, mam riesenie :)

>>> def f(num,a,b,typ):
        st = lambda a, b, typ: '%%%s.%s%s' % (str(a),str(b),str(typ))
        return st(a,b,typ) % num

>>> f(a,11,3,'f')
'  12345.679'
>>> f(a,12,4,'e')
'  1.2346e+004'