Format

Format is a custom pipe to format any string into a type by an identifying string

Currency

someNumberVar | format : 'currency : USD : true'

Input: someNumberVar: string = '435.23528';

Output: {{someNumberVar | format : 'currency : USD : true'}}

Currency format is like this: {{'CurrencyCode : ShowSymbol?'}}

Number/Decimal

someNumberVar | format : 'number : 1.0-2'

Input: someNumberVar: string = '435.23528';

Output: {{someNumberVar | format : 'number : 1.0-2'}}

Number format is like this: {{'{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}'}}

Date/DateTime

someTimestamp | format : 'dateTime : MMM d, y h:mm:ss a'

Input: someTimestamp: number = 1442187616000;

Output: {{someTimestamp | format : 'dateTime : MMM d, y h:mm:ss a'}}

Data Types Supported

Loading table...

Import


import {{'{'}}FuiFormatPipeModule{{'}'}} from 'fuel-ui'; //module
import {{'{'}}FormatPipe{{'}'}} from 'fuel-ui'; //class

Getting Started

Format pipe is used to format any string into a type by an identifying string. This is good for when you know the format of the output, but don't necessarily know the input type

Usage




export class FormatExample {{'{'}}
    someNumberVar: string = '435.23528';
    someTimestamp: number = 1442187616000;
{{'}'}}

Parameters

Loading table...