File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ export default {
121
121
- [ truncate] ( #truncate )
122
122
- [ number] ( #number )
123
123
- [ bytes] ( #bytes )
124
+ - [ percent] ( #percent )
124
125
- [ currency] ( #currency )
125
126
- [ pluralize] ( #pluralize )
126
127
- [ ordinal] ( #ordinal )
@@ -258,6 +259,26 @@ export default {
258
259
{{ 2000000000 | bytes (4 ) }} // => 1.8626 GB
259
260
```
260
261
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
+
261
282
#### currency
262
283
263
284
+ Arguments:
@@ -494,6 +515,9 @@ var Vue2FiltersConfig = {
494
515
bytes: {
495
516
decimalDigits: 2
496
517
},
518
+ percent: {
519
+ decimalDigits: 2
520
+ },
497
521
currency: {
498
522
symbol: ' $' ,
499
523
decimalDigits: 2 ,
You can’t perform that action at this time.
0 commit comments