cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert String value to java.lang.BigDecimal

Former Member
0 Kudos

Hi

How to convert String value to BigDecimal.

Thanks in Advance

Ananda

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Use BigDecimal("StringValue") constructor. Here string value should represent a valid number

example 

BigDecimal myBigNum = new BigDecimal("123654789654");

Former Member
0 Kudos

I had a timestamp (DEC 21,7) field which is mapped as a BigDecimal and used the following

To represent 28th Dec 2005, 10:11:12 am:

BigDecimal x = new BigDecimal("20051228101112");

To add

 new BigDecimal("..").add( new BigDecimal(" .." );

Can you clarify on what do you mean on using it with context attributes ?

Former Member
0 Kudos

new BigDecimal(String value)

Armin

Former Member
0 Kudos

Thanks but how to :

1)Add 2 Bigdecimal values

2)Use this with context attributes.

Please help

Thanks

Ananda

Former Member
0 Kudos

Read the javadoc for java.math.BigDecimal.

The Web Dynpro table tutorial shows how to use BigDecimal in a Web Dynpro application.

Armin