fork(1) download
  1. import java.text.DecimalFormat;
  2. import java.text.DecimalFormatSymbols;
  3. import java.math.BigDecimal;
  4.  
  5. public class Main {
  6. public static void main(String[] args) {
  7. var formatter = new DecimalFormat("#,###.##");
  8. var s = new DecimalFormatSymbols();
  9. s.setDecimalSeparator(',');
  10. s.setGroupingSeparator('.');
  11. formatter.setDecimalFormatSymbols(s);
  12. var numero = new BigDecimal("10000999999999999999100.69");
  13. System.out.println(formatter.format(numero));
  14. }
  15. }
Success #stdin #stdout 0.09s 34576KB
stdin
Standard input is empty
stdout
10.000.999.999.999.999.999.100,69