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 {
    private static DecimalFormat df = new DecimalFormat("#.###");

    public static double formatDouble(double raw) {
        String res = df.format(raw).replaceAll(",", ".");
        return Double.parseDouble(res);
    }
}