How to set thousands separator in Java? I have String representation of a BigDecimal that I want to format with a thousands separator and return as String.
You can use format function with ",";
int no = 124750; String str = String.format("%,d", no); //str = 124,750
"," includes locale-specific grouping characters.
docs
1.4m articles
1.4m replys
5 comments
57.0k users