Is there an easy formatter to format my String as a price?
So my string is: 300000 i'd like to "300 000" with space
or 1000000 "1 000 000"
Leslie
This does it:
String s = (String.format("%,d", 1000000)).replace(',', ' ');
Use Formatter class to format string
format("%,d", 1024);
After that replace , with space.
http://developer.android.com/reference/java/util/Formatter.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With