Here you can find the source of getDecimalValue(String value, Object franctionDigits)
public static Number getDecimalValue(String value, Object franctionDigits)
//package com.java2s; /*//from w ww. jav a2 s.c o m * Copyright (C) 2006-2016 Talend Inc. - www.talend.com * * This source code is available under agreement available at * %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt * * You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages * 92150 Suresnes, France */ import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static Number getDecimalValue(String value, Object franctionDigits) { if (value == null || "".equals(value)) { return null; } BigDecimal bigdecimal = new BigDecimal(value); if (franctionDigits != null && !franctionDigits.equals("")) { return bigdecimal.setScale(Integer.parseInt(franctionDigits.toString()), RoundingMode.HALF_UP); } return bigdecimal.setScale(2, RoundingMode.HALF_UP); } }