public class CoreAlgorithms extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CoreAlgorithms.LegacyRoundingConfigProvider |
| Modifier and Type | Field and Description |
|---|---|
static String |
CFG_LEGACY_ROUNDING |
| Constructor and Description |
|---|
CoreAlgorithms() |
| Modifier and Type | Method and Description |
|---|---|
static double |
convert(double sourceFactor,
double targetFactor,
double value)
Used to converts a numeric price value from one currency to another.
|
static double |
round(double value,
int digits)
Rounds a double value to the specified digits.
|
static CoreAlgorithms.LegacyRoundingConfigProvider |
setLegacyConfigProvider(CoreAlgorithms.LegacyRoundingConfigProvider provider) |
public static final String CFG_LEGACY_ROUNDING
public static CoreAlgorithms.LegacyRoundingConfigProvider setLegacyConfigProvider(CoreAlgorithms.LegacyRoundingConfigProvider provider)
public static double round(double value,
int digits)
value - digits - round(value * 10 ˆ digits) / 10 ˆ digits
public static double convert(double sourceFactor,
double targetFactor,
double value)
round(double,int) to achieve this.sourceFactor - the conversionFactor of the source currencytargetFactor - the conversionFactor of the target currencyvalue - the source valuevalue * targetFactor / sourceFactor
Copyright © 2017 SAP SE. All Rights Reserved.