ExtendedNumberFormat

Class graphomate.ui.ExtendedNumberFormat


extends sap.ui.core.Element


Quick Start

Creates a number format definition that can be used for example in the aggregations "extendedNumberFormat" and "extendedNumberFormatPercent" of a graphomate.ui.charts.Chart. It will be applied to number labels if the label format mode is set to extended.

Usage Example
var chart = new graphomate.ui.charts.Chart({
    chartType: graphomate.ui.charts.enums.ChartType.Bar,
    series1: [5, 16, 17, 20],
    labelFormatMode: graphomate.ui.enums.LabelFormatMode.Extended,
    extendedNumberFormat: new graphomate.ui.ExtendedNumberFormat({
		suffix: "$",
		decimalPlaces: 2
	})
});





Constructor Details

new graphomate.ui.ExtendedNumberFormat(id?:string, settings?:object)

Accepts an id and a settings object or one or none of them. The settings object defines initial property values. Every setting can also be set using the related setter method. The supported settings are:

Properties:
  • negativeSign : string (default: "-")
  • prefix : string (default: "")
  • thousandsSeparator : string (default: ".")
  • decimalSeparator : string (default: ",")
  • scalingFactorExponent : int (default: 0)
  • decimalPlaces : graphomate.ui.types.UnsignedInteger (default: 1)
  • suffix : string (default: "")




Property Details

Each property "sampleProperty" can be set using the related setter "setSampleProperty". Each setter expects a valid value for the related property as input parameter and throws an exception for invalid values. It returns the "this context" for method chaining. Each property "sampleProperty" can also be gotten using the related getter method "getSampleProperty". It expects no input parameters and returns the current value of the related property. Each property that represents or partially contains indices excepts a 0 based index.

The following properties are available:


Property NameTypeDescription
negativeSignstringSets a prefix for negative numbers.
prefixstringSets a prefix for all formatted numbers.
thousandsSeparatorstringSets the thousands separator sign.
decimalSeparatorstringSets the decimal separator sign.
scalingFactorExponentintSets the power of ten that will be used as a scaling factor. A value of -3 for this property for example would cause a value label to be multiplied by 10-3.
decimalPlacesgraphomate.ui.types.UnsignedIntegerSets the number of decimal places.
suffixstringSets a suffix for all formatted numbers.