Skip to content

Commit fac0d5d

Browse files
committed
FIX: Cast float to string to Decimal round correctly, fixes #10
1 parent 558db88 commit fac0d5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labfis/uncertainty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def __round__(self, p: int = 0) -> labfloat:
229229
current_contex = getcontext()
230230
setcontext(self.context)
231231

232-
u = Decimal(self._uncertainty)
233-
m = Decimal(self._mean)
232+
u = Decimal(str(self._uncertainty))
233+
m = Decimal(str(self._mean))
234234

235235
r = p - u.adjusted() * (not p)
236236

0 commit comments

Comments
 (0)