Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static String MybigdecimalToString(BigDecimal myBigD) {
        myBigD = myBigD.setScale(2);
        DecimalFormat df = new DecimalFormat();
        df.setMaximumFractionDigits(2);
        df.setMinimumFractionDigits(0);
        return df.format(myBigD);
    }
}