Reputation: 3
i have a Big Decimal like this for example. i want to negative it's value. it has a string.
String a = "65";
BigDecimal example = new BigDecimal(a);
//i want to have (-65)
Upvotes: 0
Views: 371
Reputation: 2861
String a = "65";
BigDecimal example = new BigDecimal(a);
System.out.println( example.negate() ); // prints -65
Upvotes: 3