scmc.SCMCommonAPIglobal with sharing class SCMCommonAPI This class is used to support common helper methods across the Order and Inventory Management product suite. Methods
getNumberDecimalsglobal static Integer getNumberDecimals() Gets the default number of decimals for the organization. Return ValueAn interger that is the number of decimals set for the organization. scaleAmountglobal static Decimal scaleAmount(Decimal amount) Scale an amount to the number of decimals that is set for the organization. Input Parameters
Return ValueThe original amount scaled to the number of decimals that is set for the organization. decimalFormatStringForLocaleglobal static String decimalFormatStringForLocale() Create an editing map that reflects the number of decimals set for the organization. Will only work for US currency. Return ValueA valid String for displaying price or cost fields that will format a parameter with appropriate punctuation and decimals. formatDecimalForLocaleglobal static String formatDecimalForLocale(Decimal decimalValue) Create an editing map that reflects the number of decimals set for the organization and the locale of the user. Input Parameters
Return ValueA valid String of a decimal that is formatted with the appropriate punctuation and decimals. convertglobal static Decimal convert(Decimal amount, String fromCurrency, String toCurrency, Boolean scale) Convert an amount from one currency to another. The conversion uses the current exchange rate in the Salesforce multi-currency definition. Input Parameters
Return ValueA Decimal value that is the amount you specified converted to the new currency. |