📅  最后修改于: 2023-12-03 14:39:12.192000             🧑  作者: Mango
The DecimalPipe is an Angular built-in pipe that transforms a numeric value into a string representation formatted according to the specified format. It is a very useful tool for formatting currencies, percentages, and other numeric values.
{{ value_expression | decimal [ : digitsInfo [ : locale ] ] }}
{{ 12345678.901 | decimal }}
Output: 12,345,678.901
{{ 123.45678 | decimal:'2.2-2' }}
Output: 123.46
{{ 12345678.901 | decimal:'2.2-2':'de' }}
Output: 12.345.678,90
The DecimalPipe is a very useful tool for formatting numeric values in Angular. You can customize the output format by using the digitsInfo argument and change the locale through the third argument.