Skip to content

Commit ef69a13

Browse files
gonsaletmrodriguezg1991
authored andcommitted
Improved currency gender handling, now splitting 'dollars' and 'cents' parts on
1 parent 72f1f88 commit ef69a13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

num2words/lang_ES.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def to_currency(self, val, currency='EUR', cents=True, separator=' con',
367367
# Source: https://www.rae.es/dpd/una (section 2.2)
368368

369369
# split "dollars" part from "cents" part
370-
list_result = result.split(" con ")
370+
list_result = result.split(separator + " ")
371371

372372
# "DOLLARS" PART (list_result[0])
373373

@@ -403,6 +403,6 @@ def to_currency(self, val, currency='EUR', cents=True, separator=' con',
403403
list_result[1] = list_result[1].replace("uno", "un")
404404

405405
# join back "dollars" part with "cents" part
406-
result = " con ".join(list_result)
406+
result = (separator + " ").join(list_result)
407407

408408
return result

0 commit comments

Comments
 (0)