Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to Negate a BigDecimal


{filelink=11209}

 
import java.math.BigDecimal;
 
public class NegatBigDec
{
 
  public static void main(String[] argv) throws Exception
  	{
    BigDecimal val = new BigDecimal("642014.23");
 
    // Add<span id="more-8"></span> "-"
    val = val.negate();
 
    System.out.println (val);
 
  }
}

Users who found this page were searching for:

  • bigdecimal negate example

No comments yet.

Leave a Comment