core/common/number.pipe.ts
Formats a value according to digit options and locale rules.
Extends the behavior of Angular's number
pipe by
providing an option to define if a truncated value should be
rounded up or down (with the number
pipe the
value will be rounded using the "to-nearest" method).
<span>{{ 3.45612 | c8yNumber: 'ceil':'1.1-3' }}</span> <!-- 3.457 -->
<span>{{ 3.46 | c8yNumber: 'ceil':'1.3-3' }}</span> <!-- 3.460 -->
<span>{{ 3.45685 | c8yNumber: 'floor':'1.1-3' }}</span> <!-- 3.456 -->```
Name | c8yNumber |
transform | |||||||||||||||
transform(value: number | string, round: "ceil" | "floor" | null | undefined, digitsInfo?: string, locale?: string)
|
|||||||||||||||
Parameters :
Returns :
string | null
|
transform | |||||||||||||||
transform(value: null | undefined, round: "ceil" | "floor" | null | undefined, digitsInfo?: string, locale?: string)
|
|||||||||||||||
Parameters :
|
transform | ||||||||||||||||||||
transform(value: number | string | null | undefined, round: "ceil" | "floor" | null | undefined, digitsInfo?: string, locale?: string)
|
||||||||||||||||||||
Parameters :
Returns :
string
|