Here you can find the source of formatPercentDecimalDouble(Object input)
public static Double formatPercentDecimalDouble(Object input)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.math.BigDecimal; public class Main { public static Double formatPercentDecimalDouble(Object input) { if (checkInput(input)) { BigDecimal bd1 = new BigDecimal(input.toString()); BigDecimal bd2 = new BigDecimal("100"); //$NON-NLS-1$ return bd1.multiply(bd2).doubleValue(); }/*w ww .j a v a 2 s. c o m*/ return null; } /** * DOC Zqin Comment method "checkInput". * * @param input the object that was formated. * @return true if the input is valid, else false; */ private static boolean checkInput(Object input) { if (input == null || "".equals(input)) { //$NON-NLS-1$ return false; } else { Double db = new Double(input.toString()); if (db.equals(Double.NaN)) { return false; } } return true; } }