How not to get a comma on the output?

    NumberFormat df = NumberFormat.getNumberInstance();
    df.setMaximumFractionDigits (2);
    df.setMinimumFractionDigits (2);

    double[] floatValues = new double[5];
    String Input;

    Input = stdin.readLine();
    String[] floatValue = Input.split("\\s+");      

    while (letter != 'q' && letter != 'Q'){
        for (int i = 0; i < floatValue.length; ++i){
        floatValues[i] = Double.parseDouble (floatValue[i]);

        System.out.println("LWL:" + df.format((floatValues[1])));
        System.out.println("Hull Speed:" + df.format(1.34 * Math.sqrt(floatValues[1])));

This is part of the code, I'm suppose to input 5 numbers like: 34.5 24.0 10.2 11200 483. My program runs perfectly, the only problem is that the output is suppose to be 11200 and I get 11,200. How do I get it to not output the comma. Thank You.

Jon Skeet
people
quotationmark

This is the issue:

NumberFormat df = NumberFormat.getNumberInstance();

That's getting the format for your machine's default locale, which presumably uses a comma as the decimal point. Just use the US locale:

NumberFormat df = NumberFormat.getNumberInstance(Locale.US);

That will then use a dot for the decimal point regardless of your machine's locale.

people

See more on this question at Stackoverflow