Created
March 29, 2019 14:18
-
-
Save ShanikaNishadhi/085cd5aab1e62e5c0091b9fe4b83c855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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