Java BigDecimal hasSignedChanged(final BigDecimal v1, final BigDecimal v2)

Here you can find the source of hasSignedChanged(final BigDecimal v1, final BigDecimal v2)

Description

has Signed Changed

License

Apache License

Return

true if v1.signum() != v2.signum().

Declaration

public static boolean hasSignedChanged(final BigDecimal v1, final BigDecimal v2) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

public class Main {
    /**/*from  w w w  . j  ava2 s  . co  m*/
     * @return true if v1.signum() != v2.signum().
     */
    public static boolean hasSignedChanged(final BigDecimal v1, final BigDecimal v2) {
        return signum(v1) != signum(v2);
    }

    /**
     * If value is null return 0 otherwise the signum().
     * 
     * @param value
     * @return
     */
    public static int signum(final BigDecimal value) {
        return value == null ? 0 : value.signum();
    }
}

Related

  1. getUserLink(BigDecimal id, String name)
  2. getValue(BigDecimal value, Class clazz)
  3. getValue(String key, Map valuesMap)
  4. getWithoutTrailingZeroes(@Nullable final BigDecimal aValue)
  5. hash(BigDecimal bd)
  6. htmlFooter(String providerNo, int count, BigDecimal total)
  7. humanReadableByteCount(BigDecimal bytes, Boolean si)
  8. incRatio(BigDecimal o1, BigDecimal o2)
  9. intToBigDecimal(int i)