Java BigDecimal from String string2BigDecimal(String s)

Here you can find the source of string2BigDecimal(String s)

Description

string Big Decimal

License

Apache License

Declaration

public static BigDecimal string2BigDecimal(String s) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

public class Main {
    public static BigDecimal string2BigDecimal(String s) {
        try {//  ww w. j  av a2 s  .c o m
            if (s == null || "".equals(s.trim())) {
                return null;
            } else {
                return new BigDecimal(s);
            }
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. string2BigDecimal(String aValue)
  2. string2BigDecimal(String st)
  3. String2BigDecimal(String str)
  4. stringToBigDecimal(String numberString)
  5. stringToBigDecimal(String src, int[] endPos)