Using NumberFormat class:
For English:
NumberFormat nf_us = NumberFormat.getInstance(Locale.US);
String number_us = nf_us.format(1000000);
For German:
NumberFormat nf_ge = NumberFormat.getInstance(Locale.GERMAN);
String number_ge = nf_ge.format(1000000);
More Related Contents:
- Extracting only digits from a String [closed]
- How can I fix ‘android.os.NetworkOnMainThreadException’?
- Firestore whereEqualTo, orderBy and limit(1) not working
- How to delete firebase data after “n” days
- Can’t create handler inside thread that has not called Looper.prepare() inside AsyncTask for ProgressDialog
- ANDROID: How to gain root access in an Android application?
- How to change color of hamburger icon in material design navigation drawer
- Android – How to take screenshot programmatically
- customised listview using arrayadapter class in android
- ‘Source code does not match the bytecode’ when debugging on a device
- How to draw circle by canvas in Android?
- JCenter deprecation; impact on Gradle and Android
- How can I give an imageview click effect like a button on Android?
- How to check permission in fragment
- Center message in android dialog box
- Google Cloud Messaging – messages either received instantly or with long delay
- == and .equals() not working in java [duplicate]
- NullPointerException on Button.findViewById()
- How to parse a JSON Input stream
- Read/write .txt file with special characters
- How to fix the ”module java.base does not “opens java.io” to unnamed module ” error in Android Studio?
- Change icons of checked and unchecked for Checkbox for Android
- Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified
- Using AsyncTask with passing a value
- Looping Error on Android Emulator
- Problems with Firestore connections executing threads
- how do I get file size of temp file in android?
- how to programatically theme an activity to be like a dialog?
- If-else working, switch not [duplicate]
- myLocationOverlay change the marker