Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.text.DecimalFormat;

public class Main {
    /**
     * Rounds the given results to two decimal places.
     * 
     * @param results
     */
    private static void roundResults(double[] results) {
        for (int i = 0; i < results.length; i++) {
            double result = results[i];
            DecimalFormat twoDForm = new DecimalFormat("#.##");
            results[i] = Double.valueOf(twoDForm.format(result));
        }
    }
}