Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Formatting number as per specific locale in java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


amit kumar
Formatting number as per specific locale in java
0 Answer(s)      2 years and 7 months ago
Posted in : Java Beginners


Hi, I am trying to print the number as per locale. I tried below, but it still prints in English locale.

public class loctest {

public static void main(String[] args){

Locale.setDefault(Locale.CHINESE); //set chinese defaullt locale
System.out.println(Locale.getDefault()); //returns zh.

//format the number as per locale --> currently chinese System.out.println(String.format(Locale.getDefault(),"%d",123));

} } //output: zh 123 Am I doing anything wrong?

Thanks. Amit


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Formatting number as per specific locale in java
Formatting number as per specific locale in java  Hi, I am trying to print the number as per locale. I tried below, but it still prints in English...(Locale.getDefault()); //returns zh. //format the number as per locale -->
Formatting and Parsing Locale-Specific Currency
Formatting and Parsing Locale-Specific Currency In this section, you will learn how to format and parse the locale specific currency. Through the formatting... are going to format the number into locale specific currency using NumberFormat class
Advertisements
Formatting and Parsing a Locale-Specific Percentage
Formatting and Parsing a Locale-Specific Percentage In this section, you will learn how to format and parse a locale-specific percentage. On the basis... are going to format a number into locale specific percentage using NumberFormat class
Formatting and Parsing a Number for a Locale
Formatting and Parsing a Number for a Locale In this section, you will learn how to format and parse a number for a Locale. Formatting converts a date, time... of the date, time, number, or message. Java has provide different classes
How will you load a specific locale? - Java Beginners
How will you load a specific locale?  HI, Please tell me how to load a specific locale in Java program. Thanks   Hi Friend, You can use ResourceBundle.getBundle("Locale.UK"); For more information, visit
Java Locale
Java Locale         A locale class in java api represents a specific geographical, political, or cultural region. In java computing, locale defines a set of parameters
Java Locale
Java Locale  How will you load a specific locale?   Hi Friend, A locale is the part of a user's environment that brings together.../java/javadate/locale-format.shtml http://www.roseindia.net/tutorial/java
Formatting and Parsing a Time for a Locale
Formatting and Parsing a Time for a Locale In this section, you will learn how to format and parse a time for a locale. Java has provide several classes... formatter with the given formatting style for the given locale. The method format
NumberFormat In Java
class for all number formats. This class gives methods for specifying the locale specific number formats and their name. Using this class you can create your code independent from the locale specific for decimal points, thousand
Locale Specific Date validations through JavaScript/Ajax...
Locale Specific Date validations through JavaScript/Ajax...  Hi, I am developing an JSP Application which supports I18N(Internationalization). In my... validation, but change the error/information message as per your local. It can be done
Formatting and Parsing a Date for a Locale
Formatting and Parsing a Date for a Locale In this section, you will learn how to format and parse a date for a locale. Java has provide the utility... have used Locale class. This class provides this advantage. In the given
Number Format Example
Number Format Example       This Example shows you how to format numbers according to the locale. In the code given below we are formatting number according to the locale
What is Locale - Java Beginners
the following links: http://www.roseindia.net/java/javadate/locale-format.shtml http...What is Locale  Hi, What is Locale? Write example to show the use of Locale. Thanks   Hi Friend, A locale is the part
How to format number in Java?
Learn about the code of formatting the number in Java This tutorial explains you how to format the number in Java. There are number of situations where we... of formatting the number is to use the DecimalFormat class. This class is most
Java get System Locale
Java get System Locale       In this section, you will learn how to obtain the locale. We are providing you an example which will obtain the locale of the system
Formatting and Parsing a Time for a Locale Using Default Formats
Formatting and Parsing a Time for a Locale Using Default Formats... formats. There are different classes for formatting and parsing number, message... formatter with the given formatting style for the given locale. The method
Scanning and Formatting in Java
to the specified locale. public Scanner useLocale(Locale locale) Formatting In Java...Scanning and Formatting in Java In this we will discuss about the Java I/O Scanning and Formatting. In the perspective of programming in Java I/O we
Locale with SimpleDateFormat - Java Beginners
Locale with SimpleDateFormat  What does that mean when instantiating a SimpleDateFormat object,specify a locale? Its just a good programming... in different formats.If you instantiate SimpleDateFormat class without a Locale
Java formatting - Java Beginners
Java formatting  I'm creating a 'gift certificate' out line thing. The certificate has to have borders But the right borders will move when...://www.roseindia.net/java/ Thanks
Java Set Default Locale
Java Set Default Locale       Setting Default Locale Example in Java Locale can be set also in our java programs by using the method setDefault() of Locale class
Java get default Locale
Java get default Locale       Locale object is a representation of geographical, political, or cultural region. We can get and set our default locale through the java programs
Formatting a Message Containing a Number
Formatting a Message Containing a Number In this section, you will learn how... that contains a number. The class MessageFormat provides advanced message formatting. It allows advanced value formatting, dependency on Locale and precompilation
Formatting a Number in Exponential Notation
Formatting a Number in Exponential Notation In this section, you will learn how to format a number in Exponential Notation. Java has designed several classes for parsing and formatting the numbers like DecimalFormat class. This class
Java - How to read a string line per line
Java - How to read a string line per line  Java - How to read a string line per line I am trying to find the tutorial for reading the String line... to read the big String line per line? Is there any API available in Java
How to parse an XML as per dtd in java
How to parse an XML as per dtd in java  Please help to tell me a logic to parse an xml as per mentioned dtd inside xml. I've used SAX and DOM both but that only check for well formed xml tags but don't validate as per DTD. please
Java get System Locale
Java get System Locale       In this section, you will learn how to obtain the locale. We are providing you an example which will obtain the locale of the system by using
Formatting a Number Using a Custom Format
Formatting a Number Using a Custom Format In this section, you will learn how to format a number using a custom format. A number can be formatted in different ways. Java has designed several classes to format the number. Using
What is the Locale class?
in java program. thanks,   Hi, The Locale class in Java is Java... region. IN Java computing, locale describes a set of parameters to classify... is called locale-sensitive. For details visit What is Locale class in Java
to retrive e mails as per user name - Java Beginners
to retrive e mails as per user name  hi friends, how to retrive e mails as per user "user name " for ex: class Mail{ private String subject.../reading-message-using-java-mail.shtml Thanks
Delete specific lines from text in Java
Delete specific lines from text in Java  Hi, beginning in java, i'm trying to delete specific line from a text file. Ex: i want to delete data... number that i want to delete. how could it be possible with java. thanks a lot
Locale class
Locale class  What is the Locale class
 

 

 

DMCA.com