locale = Locale.getDefault();
}
try {
Double parsedRetVal = (Double) ObjectType.simpleTypeConvert(retVal, "Double", null, locale, false);
String template = UtilProperties.getPropertyValue("arithmetic", "accounting-number.format", "#,##0.00;(#,##0.00)");
retVal = UtilFormatOut.formatDecimalNumber(parsedRetVal.doubleValue(), template, locale);
} catch (GeneralException e) {
String errMsg = "Error formatting number [" + retVal + "]: " + e.toString();
Debug.logError(e, errMsg, module);
throw new IllegalArgumentException(errMsg);
}