+ 3

BigDecimal in java

I an not able to convert String to BigDecimal https://code.sololearn.com/cOhgaNvHAA7g/?ref=app

30th Dec 2018, 12:38 PM
harshit
harshit - avatar
3 Answers
+ 2
harshit BigDecimal.parseBigDecimal() I think there is no such method Try to do it with constructor or using DecimalFormatSymbols and DecimalFormat classes
30th Dec 2018, 1:58 PM
Michal
Michal - avatar
+ 3
BigDecimal big = new BigDecimal ("1.1"); And don't forget about import import java.math.BigDecimal;
30th Dec 2018, 12:59 PM
Michal
Michal - avatar
0
I have made changes to the code and imported the required class but I need to convert String to BigDecimal and that is not working.
30th Dec 2018, 1:55 PM
harshit
harshit - avatar