MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*Output: 
 * User's number (DEFAULT LOCALE): 1,976.083
 * */

import java.text.NumberFormat;

public class MainClass {
    public static void main(String args[]) throws Exception {
        NumberFormat numberFormat = NumberFormat.getInstance();
        numberFormat.setParseIntegerOnly(false);
        double usersNumber = 1976.0826;

        numberFormat = NumberFormat.getNumberInstance();
        System.out.println("User's number (DEFAULT LOCALE): " + numberFormat.format(usersNumber));

    }
}