Amount in words

127 views
Skip to first unread message

marek.h...@interia.pl

unread,
Feb 24, 2015, 3:05:00 PM2/24/15
to harbou...@googlegroups.com
Hi
I have a specific question for Claudia. In file /harbour/contrib/hbnf/ntow.prg is code which returns amount in English words. Have you such algorithm, but with the German lexicon?

Regards,
Marek Horodyski

elch

unread,
Feb 25, 2015, 11:47:39 AM2/25/15
to harbou...@googlegroups.com
Hi Marek,

i'm not Claudia ;-) but maybe can help out.
--and needed a bit relaxing fun for my afternoon .. :-)


Germans count reverse ;-) -- the don't say: twenty-one, but: one and twenty.

The detail in front, big units thrown afterwards.

Further they group all below one thousand together, hundreds in front of the

details, and then name the 10 ^ 3 unit afterwards.


In the attached 'afternoon fun' are two versions of the names for numbers.

Some contain special char above ASCI 127, so called 'Umlaute' with two dots

above -- they are spoken and can be written like appending an 'e'. Example:

'ö' = 'oe'.

But depending on codepage, they maybe displayed wrong -- so if you want with

'Umlaute', change the '#if 0' to a '1' ...


Further like to spell big numbers, especially for that such is good -- so i

wrote a sol10() without using hb_ntos(). Because Harbour can handle very ! big

numbers, then only loosing the precision in the lower than 16 digits once the

number got bigger than 19 digits, or to be precise: > 9223372036854775807


First test looks quite ok me, if you want to counterproof or add bigger number

names: http://de.wikipedia.org/wiki/Zahlennamen


That was what you searched for ??

At least good for my fun ... :-)


best regards

Rolf

ntow_gr.zip

elch

unread,
Feb 25, 2015, 2:59:50 PM2/25/15
to harbou...@googlegroups.com

addendum:


one little typo left with the not tested branch:

"Zwannzig" is wrong with double 'n' -- "Zwanzig" correct.

[ was too fast typing ... ;-) ]

You sure can easy correct this ...


best regards

Rolf

marek.h...@interia.pl

unread,
Feb 25, 2015, 11:22:51 PM2/25/15
to harbou...@googlegroups.com
-- 

Thanks. It's not for me. Send to someone, let them try.

Regards,

Marek Horodyski


Reply all
Reply to author
Forward
0 new messages