// make sure the divisor is not 0 to avoid NaN problems; just leave the amount as 0 and skip it in essense
if (divisor.signum() != 0) {
// multiply first then divide to avoid rounding errors
amount = baseAmount.multiply(multiplier).divide(divisor, decimals, rounding);
}
if (amount.signum() != 0) {
Map createInvoiceItemContext = FastMap.newInstance();
createInvoiceItemContext.put("invoiceId", invoiceId);
createInvoiceItemContext.put("invoiceItemSeqId", invoiceItemSeqId);
createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, adj.getString("orderAdjustmentTypeId"), null, invoiceTypeId, "INVOICE_ADJ"));
createInvoiceItemContext.put("description", adj.get("description"));