Code example for MathContext

0
	public Amount minus(Amount amount) {
		return new Amount(getAmount().subtract(amount.getAmount()));
	} 
 
	public Amount divideBy(Amount mianownik) {
		MathContext mc = new MathContext(mianownik.getAmount().precision());
		return new Amount(getAmount().divide(mianownik.getAmount(), mc));
	} 
 
	public Amount negate() { 
		return new Amount(getAmount().negate());
	} 
 
	@Override 
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	} 
 
	@Override 
	public int hashCode() { 
		return HashCodeBuilder.reflectionHashCode(this);