Parent Directory | Revision Log | Patch
revision 1.13 by charlie, Fri Nov 22 16:30:01 2002 UTC | revision 1.14 by styxman, Tue Nov 26 20:12:26 2002 UTC | |
---|---|---|
# | Line 6 | Line 6 |
6 | # convertir cualquier cosa a float. O trata, al menos (a lo sumo vas | # convertir cualquier cosa a float. O trata, al menos (a lo sumo vas |
7 | # a tener un hermoso 0.0, en vez de un Exception) | # a tener un hermoso 0.0, en vez de un Exception) |
8 | ||
9 | def a2f(a): | def a2f(a, p=2): |
10 | f=0.0; | f=0.0; |
11 | if (a) and len(str(a)) > 0: | if (a) and len(str(a)) > 0: |
12 | s=str(a); | s=str(a); |
13 | f=round(float(s), 2); | f=round(float(s), p); |
14 | return(f); | return(f); |
15 | ||
16 |
|
savannah-hackers-public@gnu.org | ViewVC Help |
Powered by ViewVC 1.1.26 |