Groovy web console

subscribe to the feed Subscribe
to this
site

Adding commas in amount

Published 3 months ago by Mak with tags price comma format numberformat
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Integer number = 0;
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US); 
String numberAsString = numberFormat.format(number);    
System.out.println(numberAsString);