Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert string numbers into comma separated integers in java?

Can any one give me some predefined methods or user defined methods to convert string numbers(example: 123455) to comma separated integer value (example: 1,23,455).

like image 506
sathish Avatar asked Jun 22 '11 12:06

sathish


1 Answers

int someNumber = 123456;
NumberFormat nf = NumberFormat.getInstance();
nf.format(someNumber);
like image 200
Divesh Avatar answered Sep 21 '22 15:09

Divesh