Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import java.util.Locale;
import java.text.NumberFormat;
class LocaleConstantExample {
public static void main(String[] args) {
Locale usLocale = Locale.forLanguageTag("en-US");
Locale deLocale = Locale.forLanguageTag("de-Germany");
long number = 123456789L;
NumberFormat denf = NumberFormat.getInstance(deLocale);
NumberFormat usnf = NumberFormat.getInstance(usLocale);
System.out.println( denf.format(number) );
System.out.println( usnf.format(number) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.