In Java, I need to add a thousands separator to a decimal number formatted as a String. However, I do not want a millions or billions separator... just a thousands separator with the existing fractional part of the number preserved.
9 == 9
999.999 == 999.999
9,999 == 9999
999999,999.999 == 999999999.999
I do not strictly need to use printf, but the conversion must be as fast as possible.
The input and output type must both be String.
Thanks!