Let's say I have a String variable that looks like this.
String milli = "2728462"
is there a way to convert it to look something like this
2,252,251
which I guess I want as a long.
The thing is it will be passing strings in this format
1512
52
15010
1622274628
and I want it to place the ,
character where it needs, so if the number is 1000
then place it like so 1,000
and 100000
then 100,000
etc.
How do I properly convert a String variable like that?
Because this
String s="9990449935";
long l=Long.parseLong(s);
System.out.println(l);
Will output 9990449935
and not 9,990,449,935