public class KualiDecimalUtils extends Object
| Constructor and Description |
|---|
KualiDecimalUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.kuali.rice.core.api.util.type.KualiDecimal[] |
allocateByQuantity(org.kuali.rice.core.api.util.type.KualiDecimal amount,
int divisor)
Allocates evenly a sum of money amongst a number of targets.
|
static org.kuali.rice.core.api.util.type.KualiDecimal[] |
allocateByRatio(org.kuali.rice.core.api.util.type.KualiDecimal amount,
double[] ratios)
Allocates by ratio a sum of money amongst a number of targets.
|
static org.kuali.rice.core.api.util.type.KualiDecimal |
safeMultiply(org.kuali.rice.core.api.util.type.KualiDecimal value,
double multiplier)
Makes sure no null pointer exception occurs on fields that can accurately be null when multiplying.
|
static org.kuali.rice.core.api.util.type.KualiDecimal |
safeSubtract(org.kuali.rice.core.api.util.type.KualiDecimal value,
org.kuali.rice.core.api.util.type.KualiDecimal subtrahend)
Makes sure no null pointer exception occurs on fields that can accurately be null when subtracting.
|
public KualiDecimalUtils()
public static org.kuali.rice.core.api.util.type.KualiDecimal[] allocateByQuantity(org.kuali.rice.core.api.util.type.KualiDecimal amount, int divisor)
amount - the total amount to allocatedivisor - the number of targets to allocate topublic static org.kuali.rice.core.api.util.type.KualiDecimal[] allocateByRatio(org.kuali.rice.core.api.util.type.KualiDecimal amount, double[] ratios)
amount - the total amount to allocateratios - an array of ratios according to which the total amount is to be allocatedpublic static org.kuali.rice.core.api.util.type.KualiDecimal safeMultiply(org.kuali.rice.core.api.util.type.KualiDecimal value, double multiplier)
value - multiplier - public static org.kuali.rice.core.api.util.type.KualiDecimal safeSubtract(org.kuali.rice.core.api.util.type.KualiDecimal value, org.kuali.rice.core.api.util.type.KualiDecimal subtrahend)
value - subtrahend - Copyright © 2004–2015 The Kuali Foundation. All rights reserved.