Translating the Cardinal Numerals to Words

Yes, it is generating the correct result in English. But, I couldn't find where "hundred" is to translate it to the target language.

Input: 1256
Output: አንድ ሺህ ሁለት Hundred አምሳ ስድስት
Cardinals [text].kmmacros (25.4 KB)

If it translated the number in English correctly, then what are you asking me to do? I don't understand. Do you have another macro that translates into Ethiopian? Is that where the problem is? If you want me to fix your macro, you have to show me your macro.

Oh, you modified my macro to support Ethiopian. Okay, then I can look at it. I didn't know you modified it.

Okay I found the place you missed. It's in there, inside an action that you didn't open by double clicking on it. It looks like this:

Open up that action and see the word "Hundred".

I see. I was expecting it with the other numerals in the green.


I guess that was my mistake. I'm not perfect. Glad it's working.

1 Like

it is absolutely amazing macro. I have tried a very large number: worked magically.

If you have time, it would be nice if you can include "hundred" with the other numerals. I think this macro needs to be included in the best Macro list ( Best Macro List - #13) so that others will use it as well.

Unlike the Python and Perl tools listed above, this has the unlimited potential of functioning even for the most obscure languages of the words.
I like the fact that I don't need to request the developer to include this language or that language.

Thanks for the fine compliments.

I'm not sure what that means, above. EDIT: I think I understand what you mean (maybe). You want them all in one place so they are easier to find. I could do that.

Now that I have a better idea of what your were going to do with it, I could have made it a little easier for you by putting all the "words" at the top of the macro for ease of use. But I really didn't know you were going to modify it. That's because I thought you were going to write your own macro to modify my output, rather than modify my macro.

I mean: the Green marked macros are for the user to modify (do the translation). You have four of them.

  • the box that contains the ones
  • the box that contains the tens
  • again the ones
  • finally, the millions

These boxes contain all the text that needs to be translated to a target language. For a new user, it would be hard to find "hundred" barbecue it is not included in these boxes (or its own green box).

I am going to do a translation of your macro for every language I am going to process.

Well, I see your point, and I can make some changes, but you may not have considered this fact: the word "hundred" is treated differently from words like "thousand" Count how many times you see the word "hundred" in this sample:

One Hundred Twenty Three Billion Four Hundred Fifty Six Million Seven Hundred Eighty Nine Thousand One Hundred Twenty Three

You see, the word "Hundred" is special because it can occur many, many times. Whereas the word "million" can appear only once.

1 Like

Don't do that until I update my macro. I can make it MUCH EASIER if you wait for an update. I'll try to update my macro now. It will take a minimum of 10 minutes, but if it takes longer than 20 minutes, you will have to wait until tomorrow.

1 Like

Right. I didn't notice that "hundred" is a special number. Thanks

Okay I just updated it and it seems to be working. Let me test it for another minute then I'll upload it here. Here it is. It will be much easier for you to edit. I can't remember if you wanted the last line in this macro or not, so you can remove it if you don't need it.

It's a new version that will make it easier for you to edit the variables right at the front of the macro. I could do even better things to make it support multiple languages at the same time, but that would take an hour.

Cardinals [text].kmmacros (25 KB)

It is ok. You don't have to worry about the translation. You can simply write a little comment to indicate that these boxes are up for translation.

  • I hope you now know why I want "tens one" rather than "eleven". Most languages use that method. The number of language that use "twelve" kind of method rather "tens two" is smaller.

Okay, well, there it is for today. It should meet your needs. But I don't mind adding support for multiple languages at the same time if you want. Let me know tomorrow. I'm nearly done for today.

Thank you so much. You made my day!

how can I keep the original numbers along side their interpretations as follows?

[1241](one thousand two hundred forty one)

I think so. Let me look at my macro again. Give me a few minutes.

What you are asking for may be a little tricky. For example by macro converts in stages, like this:

Easy as 1, then 2, then 3.
Easy as one, then 2 then 3.
Easy as one, then two, then three

So you will notice that in each stage the first number in the string is the one that gets converted in the main loop. By doing it your way, I think I can do it, but I have to think for an extra 15 minutes.

1 Like

Yes, I understand bit. you have integrated the processing into the Part 1 variable. I was trying to keep the original number into a named clipboard, and then concatenate with the results of the Part 2 variable. But, your method is pretty advanced: cannot get my head around it.