Skip to content

Commit 2935a34

Browse files
committed
fixed the fix of formating numbers - fixes #4
1 parent c4b2a12 commit 2935a34

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

labfis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright © 2020 labfis.py
44
# (see LICENSE for details)
55

6-
__version__ = '1.1.5'
6+
__version__ = '1.1.6'
77

88
# Local imports
99
from labfis.main import labfloat

labfis/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@ def format(self):
5959
else:
6060
r = -i
6161
r += 1
62-
for j in range(len(su)):
63-
if su[j] == "0":
62+
for digit in su:
63+
if digit == "0":
6464
r += 1
65-
elif su[j+1] == "9" and r > 0:
65+
print("zero", r)
66+
elif digit == "9" and "1" in str(round(self.uncertainty,r)):
67+
print("yes", r)
6668
m = round(self.mean, r-1)
6769
u = round(self.uncertainty, r)
6870
return((m,u))
69-
elif su[j] != ".":
71+
elif digit != ".":
72+
print("Number")
7073
m = round(self.mean, r)
7174
u = round(self.uncertainty, r)
7275
return((m,u))

0 commit comments

Comments
 (0)