Java BigDecimal from toBigDecimal(String value)

Here you can find the source of toBigDecimal(String value)

Description

Converts java.lang.String to java.math.BigDecimal

License

Apache License

Parameter

Parameter Description
value String value to be converted

Return

converted BigDecimal

Declaration

public static BigDecimal toBigDecimal(String value) 

Method Source Code

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

import java.math.BigDecimal;

public class Main {
    /**/* ww  w.j  a  v  a 2 s  .co  m*/
     * Converts {@link java.lang.String} to {@link java.math.BigDecimal}
     * @param value String value to be converted
     * @return converted BigDecimal
     */
    public static BigDecimal toBigDecimal(String value) {
        return BigDecimal.valueOf(toDouble(value));
    }

    /**
     * Converts {@link java.lang.String} to {@link java.lang.Double}
     * @param value String value to be converted
     * @return converted Double
     */
    public static Double toDouble(String value) {
        return Double.parseDouble(value);
    }
}

Related

  1. toBigDecimal(String _str)
  2. toBigDecimal(String s)
  3. toBigDecimal(String s)
  4. toBigDecimal(String s, int scale)
  5. toBigDecimal(String str)
  6. toBigDecimal(String value)
  7. toBigDecimal(String value)
  8. toBigDecimal(String value)
  9. toBigDecimal(T value)