public String formatDecimal(final Number target, final Integer minIntegerDigits, final String thousandsPointType, final Integer decimalDigits, final String decimalPointType) { if (target == null) { return null; } final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType); if (decimalNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + decimalPointType + "\""); } final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType); if (thousandsNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + thousandsPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, decimalDigits, decimalNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting decimal with minimum integer digits = " + minIntegerDigits + ", thousands point type = " + thousandsPointType + ", decimal digits = " + decimalDigits + " and decimal point type = " + decimalPointType, e); } }
public String formatDecimal(final Number target, final Integer minIntegerDigits, final Integer decimalDigits, final String decimalPointType) { if (target == null) { return null; } final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType); if (decimalNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + decimalPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, decimalDigits, decimalNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting decimal with minimum integer digits = " + minIntegerDigits + ", decimal digits = " + decimalDigits + " and decimal point type = " + decimalPointType, e); } }
public String formatInteger(final Number target, final Integer minIntegerDigits, final String thousandsPointType) { if (target == null) { return null; } final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType); if (thousandsNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + thousandsPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting integer with minimum integer digits = " + minIntegerDigits + " and thousands point type = " + thousandsPointType, e); } }
public String formatDecimal(final Number target, final Integer minIntegerDigits, final String thousandsPointType, final Integer decimalDigits, final String decimalPointType) { final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType); if (decimalNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + decimalPointType + "\""); } final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType); if (thousandsNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + thousandsPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, decimalDigits, decimalNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting decimal with minimum integer digits = " + minIntegerDigits + ", thousands point type = " + thousandsPointType + ", decimal digits = " + decimalDigits + " and decimal point type = " + decimalPointType, e); } }
public String formatInteger(final Number target, final Integer minIntegerDigits, final String thousandsPointType) { final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType); if (thousandsNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + thousandsPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting integer with minimum integer digits = " + minIntegerDigits + " and thousands point type = " + thousandsPointType, e); } }
public String formatDecimal(final Number target, final Integer minIntegerDigits, final Integer decimalDigits, final String decimalPointType) { final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType); if (decimalNumberPointType == null) { throw new TemplateProcessingException( "Unrecognized point format \"" + decimalPointType + "\""); } try { return NumberUtils.format(target, minIntegerDigits, decimalDigits, decimalNumberPointType, this.locale); } catch (final Exception e) { throw new TemplateProcessingException( "Error formatting decimal with minimum integer digits = " + minIntegerDigits + ", decimal digits = " + decimalDigits + " and decimal point type = " + decimalPointType, e); } }