-
Notifications
You must be signed in to change notification settings - Fork 531
Open
Description
I have found some issues in the Catalan translation of numbers with a decimal part.
Check the following code:
# 42.15 in Catalan should be "quaranta-dos coma quinze"
# The following code outputs "quaranta-dos punt un cinc"
print(num2words(42.15, lang='ca'))In first place, decimal separator in Catalan is a colon not a dot. That's why it should be translated into "coma" (Catalan world for colon) instead of "punt" (Catalan word for dot).
Secondly, the decimal part should be expressed as an integer number prefixed by so many zeros as found in the left side of the decimal part. So, let's see some examples:
| Number | Expected output | Code | Current output |
|---|---|---|---|
| 12.5 | dotze coma cinc | print(num2words(12.5, lang='ca')) |
dotze punt cinc |
| 12.15 | dotze coma quinze | print(num2words(12.15, lang='ca')) |
dotze punt un cinc |
| 12.05 | dotze coma zero cinc | print(num2words(12.05, lang='ca')) |
dotze punt zero cinc |
| 12.0015 | dotze coma zero zero quinze | print(num2words(12.0015, lang='ca')) |
dotze punt zero zero un cinc |
Metadata
Metadata
Assignees
Labels
No labels