Java BigDecimal is negative? 8

Posted by Jens J├Ąger on September 25, 2009

To check if a BigDecimal in Java is negative use the signum() method like it’s shown in the following snippet:

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. will Fri, 19 Mar 2010 02:02:58 CET

    Thanks, you saved my day…

  2. sats Thu, 24 Mar 2011 17:25:39 CET

    many many thanks

  3. Rohit Tue, 29 May 2012 13:01:56 CET

    Nice one

  4. sandeep Fri, 24 Aug 2012 10:53:20 CET

    thanks

  5. java2novice Mon, 30 Jun 2014 04:28:11 CET

    very nice. for more java examples, visit http://java2novice.com site

  6. MK Fri, 13 Feb 2015 22:39:55 CET

    Thanks, was really useful.

  7. Skander Tue, 31 Mar 2015 11:24:30 CET

    useful, thanks!

  8. RS Wed, 12 Apr 2017 10:47:52 CET

    Thanks! very simple and it works!

Comments

Information about Data protection