currency (filter)

Improve this Doc View Source currency

  1. filter in module ng

Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used.

Usage

In HTML Template Binding

{{ currency_expression | currency : symbol : fractionSize}}

In JavaScript

$filter('currency')(amount, symbol, fractionSize)

Arguments

Param Type Details
amount number

Input to filter.

symbol
(optional)
string

Currency symbol or identifier to be displayed.

fractionSize
(optional)
number

Number of decimal places to round the amount to, defaults to default max fraction size for current locale

Returns

string

Formatted number.

© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.4.14/docs/api/ng/filter/currency

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部