Java BigDecimal from toBigDecimal(final String string)

Here you can find the source of toBigDecimal(final String string)

Description

to Big Decimal

License

Open Source License

Declaration

public static BigDecimal toBigDecimal(final String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    public static BigDecimal toBigDecimal(final String string) {
        if (string == null || string.isEmpty()) {
            return BigDecimal.ZERO;
        }/*from www.  j  a v a2  s  .co m*/
        return new BigDecimal(string);
    }

    public static boolean isEmpty(final String string) {
        return string == null || string.trim().length() == 0;
    }
}

Related

  1. toBigDecimal(final Number n)
  2. toBigDecimal(final Number number)
  3. toBigDecimal(final Number number)
  4. toBigDecimal(final Number number)
  5. toBigDecimal(final String bigdecimal)
  6. toBigDecimal(final String value)
  7. toBigDecimal(Integer num)
  8. toBigDecimal(JsonValue val)
  9. toBigDecimal(long seconds, int nanoseconds)