Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.DecimalFormat;
import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    public static String getVersionString(final double price) {
        final NumberFormat nf = NumberFormat.getNumberInstance(Locale.US);
        final DecimalFormat df = (DecimalFormat) nf;
        df.applyPattern("###,###.####");
        final String output = df.format(price);
        return output;
    }
}