Groovy web console

subscribe to the feed Subscribe
to this

Adding commas in amount

Published 8 months ago by Mak with tags amount comma numbersystem format
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Integer amount = 1000000;
Integer temp = amount;
String tempFormatted= '';
temp = temp/1000;
tempFormatted= tempFormatted.concat(",000");
String formatted= temp as String
formatted = formatted.concat(tempFormatted);
println formatted