func (d DecimalAmount) Subtract(d2 DecimalAmount) DecimalAmount {
	newDecimal := (d.Decimal - d2.Decimal) % 100
	newValue := d.Value - d2.Value
	// subtract one if the decimal rolled over
	if newDecimal > d.Decimal {
		newValue--
	}
	return DecimalAmount{Decimal: newDecimal, Value: newValue}
}
// Subtract subtracts one DecimalAmount from another,
// accounting for integer rollover
Subtract subtracts one DecimalAmount from another,
accounting for integer rollover
// Subtract subtracts one DecimalAmount from another // accounting for integer rollover
func (d DecimalAmount) Subtract(d2 DecimalAmount) DecimalAmount {
	newDecimal := (d.Decimal - d2.Decimal) % 100
	newValue := d.Value - d2.Value
	if newDecimal > d.Decimal {
		newValue--
	}
	return DecimalAmount{Decimal: newDecimal, Value: newValue}
}
func ( d DecimalAmount ) Subtract ( d2 DecimalAmount ) DecimalAmount { newDecimal := ( d . Decimal - d2 . Decimal ) % 100 newValue := d . Value - d2 . Value if newDecimal > d . Decimal { newValue -- } return DecimalAmount { Decimal : newDecimal , Value : newValue } }
Subtract subtracts one DecimalAmount from another,
accounting for integer rollover
Subtract subtracts one DecimalAmount from another accounting for integer rollover
// subtract one if the decimal rolled over