I am trying to split number but don’t know how to do this.
I referred this link.
https://stackoverflow.com/a/12297231/1395259
Suppose I have a number 12345678.
using above link I am splitting by 3 places.So the output becomes 123 456 78.
But I want it as 12 345 678 And I want to take the string that was split in the form 12.345.678 .
Can anybody help me please??
java.text package provides all reasonable options for formatting numbers
output
using DecimalFormat directly is very flexible, but typically we can use a shorter version
which produces the same string
Different countries have different rules for formatting numbers (and dates). Usually we want our programs to be internationalized / localized and use default locale version