big Decimal Format - Java java.math

Java examples for java.math:BigDecimal Format

Description

big Decimal Format

Demo Code


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

public class Main {

    public static BigDecimal bigDecimalFormat(String strNum, int scale,
            int mode) {
        BigDecimal bigDecimal = new BigDecimal(strNum);
        BigDecimal newBigDecimal = bigDecimal.setScale(scale, mode);
        return newBigDecimal;
    }/*w  ww .  ja va2s.c  o  m*/
}

Related Tutorials