My current task includes writing-out numbers in different languages, also mandarin. I have never grappled with mandarin but I checked several resource and tested my algorithm to the best of my believe. But to really make sure that everything works fine I would highly appreciate a second look of a native speaker. Since I don't know any native speakers I came to this place looking for help.
My algorithm can be accessed here: https://codepen.io/f16r/pen/xvrwOx It is intended to work from 0 to 19999.
Any help is highly appreciated. Thank you very much!