sluongng / java-num-2-vietnamese

a library to convert numeric value to String of words in Vietnamese
7 stars 5 forks source link
invoice invoicing number-to-text number-to-words vietnam vietnamese vietnamese-language

java-num-2-vietnamese

Purpose

We have a need to generate number in vietnamese text.

This seems to be a goverment compliance requirement to have final numbers on an invoice to be presented in both numeric and litteral text form

So this is a POC to convert numbers in Long format to String Vietnamese text in java

Out of Scope

Testing

# Compile and run the main() method
>javac NumToViet.java && java NumToViet

# Or use provided Makefile
> make
javac NumToViet.java
java NumToViet
[Passed] result: |0| - |không|
Group size is1
[Passed] result: |-1| - |âm một|
Group size is1
[Passed] result: |1| - |một|
Group size is1
[Failed] result: |một| expected |một trăm|
Group size is2
[Failed] result: |một| expected |một nghìn|
Group size is1
[Failed] result: |một| expected |mười|
Some test(s) failed!
rm -f *.class

Support

If you are using this, please leave a comment inside Github Issue to let me know.

Any Pull Request to improve this would be more than welcome.

Project setup

Project was written in

Improvement

This library is just a Proof of Concepts. When use in production, there are several points that you can improve upon.