Hey – there is a ready made java action in the app store package JAM Commons:
https://appstore.home.mendix.com/link/app/71280/
The java action is called “SpelloutNumber” and takes the locale as the input (“de_DE” for Germany).
A lot easier than integration external javascript….
Here is an example for German using javascript.