Here you can find the source of parseTo_BigDecimal(String s)
public static BigDecimal parseTo_BigDecimal(String s)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.math.BigDecimal; public class Main { public static BigDecimal parseTo_BigDecimal(String s) { if (isBlank(s)) { return null; }/*from w w w.j a v a2 s . c om*/ return new BigDecimal(s); } /** * Parse anything to BigDecimal * * @param input * @return */ public static BigDecimal parseTo_BigDecimal(Number input) { if (input == null) { return null; } return new BigDecimal(input.toString()); } public static BigDecimal parseTo_BigDecimal(byte input) { return new BigDecimal(input); } public static BigDecimal parseTo_BigDecimal(double input) { if (Double.isNaN(input)) { return null; } return BigDecimal.valueOf(input); } public static BigDecimal parseTo_BigDecimal(float input) { if (Float.isNaN(input)) { return null; } return BigDecimal.valueOf(input); } public static BigDecimal parseTo_BigDecimal(int input) { return new BigDecimal(input); } public static BigDecimal parseTo_BigDecimal(long input) { return new BigDecimal(input); } public static BigDecimal parseTo_BigDecimal(short input) { return new BigDecimal(input); } /** * StringUtils from apache commons-lang3 3.3.2 * * We use this implementation in order to avoid using the common lang package and be compatible with any hadoop * distribution. * * Checks if a CharSequence is whitespace, empty ("") or null. * * @param cs the CharSequence to check, may be null * @returntrue if the CharSequence is null, empty or whitespace */ public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (Character.isWhitespace(cs.charAt(i)) == false) { return false; } } return true; } }