cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : conversion from BigDecimal to Decimal

Former Member
0 Kudos

Hi All,

I have a BigDecimal value in my application . I want to change it to decimal value. What is the method to be used and what is the procedure?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use method doubleValue() in BigDecimal

Former Member
0 Kudos

Hi Anant,

I have a attribute of type Bigdecimal,I want to change it to decimal value by using a method.plzz help me out.

Thanks

Former Member
Former Member
0 Kudos

Hi Bharath,

I think You want to convert BigDecimal to a double valueI (Since No 'Decimal' type is there in java)

Trythe method,

 
public double bigDecimalToDouble( java.math.BigDecimal bigDecimalVal )
  {
    //@@begin bigDecimalToDouble()
    double val1=Double.parseDouble(""+bigDecimalVal);
    return val1;
    //@@end
  }

let me know whether oit is useful for you.

thanks

Smitha

Former Member
0 Kudos

Hi

or you can try


  public double bigDecimalToDouble( java.math.BigDecimal bigDecimalVal )
  {
    //@@begin bigDecimalToDouble()
    double val1=bigDecimalVal.doubleValue();
    return val1;
    //@@end
  }

thanks Smitha

Former Member
0 Kudos

Hi Smitha,

Thanks for your clear explanation and solution for my problem..............

Regards,

Bharath A.

Answers (0)