Format

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

Number/Decimal

someVar | 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 {FormatPipe} from "fuel-ui/fuel-ui"'}}

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...