To check if a BigDecimal in Java is negative use the signum() method like it’s shown in the following snippet:
1 2 3 4 | public static boolean isNegative(BigDecimal b) { b.signum() == -1; } |
To check if a BigDecimal in Java is negative use the signum() method like it’s shown in the following snippet:
1 2 3 4 | public static boolean isNegative(BigDecimal b) { b.signum() == -1; } |
Tags
BigDecimal, Java, Snippets
Information about Data protection
Thanks, you saved my day…
many many thanks
Nice one
thanks
very nice. for more java examples, visit http://java2novice.com site
Thanks, was really useful.
useful, thanks!
Thanks! very simple and it works!