如何负数 android 中的 bigdecimal 值

how to negative bigdecimal's value in android

例如,我有一个像这样的小数。 我想否定它的价值。它有一个字符串。

String a = "65";
BigDecimal example = new BigDecimal(a);
//i want to have (-65)

BigDecimal.negate()

String a = "65";
BigDecimal example = new BigDecimal(a);
System.out.println( example.negate() ); // prints -65