mirror of
https://github.com/bblaz/num2words.git
synced 2025-12-06 14:52:25 +00:00
Merge branch 'iss24' of https://github.com/isnani/num2words into isnani-iss24
This commit is contained in:
@@ -115,17 +115,15 @@ class Num2Word_Base(object):
|
||||
raise TypeError(self.errmsg_nonnum % value)
|
||||
|
||||
pre = int(value)
|
||||
post = abs(value - pre)
|
||||
post = str(abs(value - pre) * 10**self.precision)
|
||||
|
||||
out = [self.to_cardinal(pre)]
|
||||
if self.precision:
|
||||
out.append(self.title(self.pointword))
|
||||
|
||||
for i in range(self.precision):
|
||||
post *= 10
|
||||
curr = int(post)
|
||||
curr = int(post[i])
|
||||
out.append(str(self.to_cardinal(curr)))
|
||||
post -= curr
|
||||
|
||||
return " ".join(out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user