savoirfairelinux / num2words

Modules to convert numbers to words. 42 --> forty-two
GNU Lesser General Public License v2.1
823 stars 496 forks source link

Croatian numbers to words #180

Open zkranjcec opened 6 years ago

zkranjcec commented 6 years ago

Dear colleagues, I have used code that was originally used for Slovenian language and modified the code for Croatian language. To have it in the package, init file should be updated with the following lines:

    _from . import lang_HR_

and _'hr': lang_HR.Num2WordHR()

in the CONVERTER_CLASSES = {....

I have tried to modify the code so it could be easilly used for Croatian language (it could be now easily used for Serbian and Bosnian language), but issues I found with decimal numbers, so I have put reccomendation for usage of the module:

_from num2words import num2words number = 13547650.40 split_num = '{:.2f}'.format(number).split('.') int_part = int(split_num[0]) decimal_part = int(split_num[1]) print(num2words(int_part,lang="hr") + " kn i " + num2words(decimalpart,lang="hr") + " lp")

Such approach will create words that will cover both part of the number, depending on the number of decimal places defined in the format...

Could anybody be so kind and check the code and put it into the package? Thank you very much!

lang_HR.zip

ventilooo commented 6 years ago

@zkranjcec

Thanks for your contribution, we'll review your code. However, since we are using a git based collaboration platform. Could you submit a proper Pull Request please ?

Best regards, Istvan

zkranjcec commented 6 years ago

Dear Istvan, I have tried to publish my branch and to create Pull Request, but I am receiving the following error: image

What should I do? I am really noob in github THank you! Best regards, Željko

ventilooo commented 6 years ago

Hi @zkranjcec You need to create a fork first.

Here is a step by step guide to your 1st Github contribution

It seems you're using github desktop, the specific tutorial with it is here

Best regards Istvan

Ablesius commented 5 years ago

Hi, this issue seems orphaned. I was wondering whether I could take it over @ventilooo

mrodriguezg1991 commented 2 years ago

Hello Any updates on this issue ???