Skip to content

Commit 4bf03f4

Browse files
committed
Added docs for percent filter
1 parent fbccdae commit 4bf03f4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export default {
121121
- [truncate](#truncate)
122122
- [number](#number)
123123
- [bytes](#bytes)
124+
- [percent](#percent)
124125
- [currency](#currency)
125126
- [pluralize](#pluralize)
126127
- [ordinal](#ordinal)
@@ -258,6 +259,26 @@ export default {
258259
{{ 2000000000 | bytes(4) }} // => 1.8626 GB
259260
```
260261

262+
#### percent
263+
264+
+ Arguments:
265+
* `{Number} [decimalDigits] - default: 0`
266+
267+
+ Examples:
268+
269+
```js
270+
{{ 10 | percent }} // => 10%
271+
{{ 100 | percent }} // => 100%
272+
{{ 1000 | percent }} // => 1000%
273+
{{ 0.97 | percent }} // => 97%
274+
```
275+
276+
Change the number of digits after the decimal point:
277+
278+
```js
279+
{{ 0.974878234 | percent(3) }} // => 97.488%
280+
```
281+
261282
#### currency
262283

263284
+ Arguments:
@@ -494,6 +515,9 @@ var Vue2FiltersConfig = {
494515
bytes: {
495516
decimalDigits: 2
496517
},
518+
percent: {
519+
decimalDigits: 2
520+
},
497521
currency: {
498522
symbol: '$',
499523
decimalDigits: 2,

0 commit comments

Comments
 (0)