3.7.7 • Published 10 months ago

xxx-qlik-formatter v3.7.7

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Qlik Formatter Library

Qlik value types

UNKNOWN:   'U',
ASCII:     'A',
INTEGER:   'I',
REAL:      'R',
FIXED:     'F',
MONEY:     'M',
DATE:      'D',
TIME:      'T',
TIMESTAMP: 'TS',
INTERVAL:  'IV',

How to use

Installation

npm install --save @vizlib/qlik-formatter
import { QlikValueFormatter } from '@vizlib/qlik-formatter';

Creating formatter instance

/**
 * In most cases usage of field based factory method will be appropriate:
 */

QlikFieldFormatter.fromField(fieldInfo: QlikMeasureInfo | QlikDimensionInfo, localeInfo?: QlikLocaleInfo);

/**
 * Or from a specific field like measure or dimension:
 */

QlikFieldFormatter.fromMeasure(measureInfo: QlikMeasureInfo, localeInfo?: QlikLocaleInfo);
QlikFieldFormatter.fromDimension(dimensionInfo: QlikDimensionInfo, localeInfo?: QlikLocaleInfo);

/**
 * Or from a specific number format:
 */

QlikFieldFormatter.fromNumberFormat(numFormat: QlikNumberFormat, localeInfo?: QlikLocaleInfo);
/**
 * In addition, it is possible to use the following static methods to create a new formatter instance based on the value type.
 */

// Date Format (D)
QlikValueFormatter.forDate(pattern?: string, localeInfo?: QlikLocaleInfo);

// Date time (TS)
QlikValueFormatter.forDateTime(pattern?: string, localeInfo?: QlikLocaleInfo);

// Time (T)
QlikValueFormatter.forTime(pattern?: string, localeInfo?: QlikLocaleInfo);

// Interval (IV)
QlikValueFormatter.forInterval(pattern?: string, localeInfo?: QlikLocaleInfo);

// Real number (R)
QlikValueFormatter.forNumber(pattern?: string, localeInfo?: QlikLocaleInfo);

// Money number (M)
QlikValueFormatter.forCurrencyNumber(pattern?: string, localeInfo?: QlikLocaleInfo);

// Integer number (I)
QlikValueFormatter.forIntegerNumber(pattern?: string, localeInfo?: QlikLocaleInfo);

// Decimal number (F)
QlikValueFormatter.forDecimalNumber(pattern?: string, localeInfo?: QlikLocaleInfo);

// Compact number with abbreviation (U)
QlikValueFormatter.forCompactNumber(pattern?: string, localeInfo?: QlikLocaleInfo);
3.7.7

10 months ago