Created
March 29, 2019 14:19
-
-
Save ShanikaNishadhi/d2339d63f0a95b5f0119a575b0a863fe 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 deLocale = Locale.GERMANY; | |
Locale usLocale = Locale.US; | |
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