mirror of
https://github.com/bblaz/num2words.git
synced 2025-12-06 06:42:25 +00:00
remove unneccery if
This commit is contained in:
committed by
Willem Van Onsem
parent
bbd9de8299
commit
a1f0392beb
@@ -90,13 +90,6 @@ class Num2Word_FA(object):
|
|||||||
self.precision = abs(Decimal(str(value)).as_tuple().exponent)
|
self.precision = abs(Decimal(str(value)).as_tuple().exponent)
|
||||||
|
|
||||||
post = abs(value - pre) * 10**self.precision
|
post = abs(value - pre) * 10**self.precision
|
||||||
if abs(round(post) - post) < 0.01:
|
|
||||||
# We generally floor all values beyond our precision (rather than
|
|
||||||
# rounding), but in cases where we have something like 1.239999999,
|
|
||||||
# which is probably due to python's handling of floats, we actually
|
|
||||||
# want to consider it as 1.24 instead of 1.23
|
|
||||||
post = int(round(post))
|
|
||||||
else:
|
|
||||||
post = int(math.floor(post))
|
post = int(math.floor(post))
|
||||||
|
|
||||||
return pre, post, self.precision
|
return pre, post, self.precision
|
||||||
|
|||||||
Reference in New Issue
Block a user