Skip to content

Commit e7c0b34

Browse files
committed
Updated build
1 parent 830a08d commit e7c0b34

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

dist/vue2-filters.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ __webpack_require__.d(other_namespaceObject, "bytes", function() { return other_
114114
__webpack_require__.d(other_namespaceObject, "pluralize", function() { return other_pluralize; });
115115
__webpack_require__.d(other_namespaceObject, "ordinal", function() { return other_ordinal; });
116116
__webpack_require__.d(other_namespaceObject, "number", function() { return other_number; });
117+
__webpack_require__.d(other_namespaceObject, "percent", function() { return other_percent; });
117118

118119
// CONCATENATED MODULE: ./src/util/index.js
119120
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
@@ -780,13 +781,40 @@ function number_toFixed(num, precision) {
780781
}
781782

782783
/* harmony default export */ var other_number = (number_number);
784+
// CONCATENATED MODULE: ./src/other/percent.js
785+
786+
/**
787+
* 12 => '12%'
788+
* 100 => '100%'
789+
* 1000 => '1000%'
790+
* 0.97 => '97%'
791+
*
792+
* @param {Number} value
793+
* @param {Number} decimals Decimal places (default: 2)
794+
*/
795+
796+
function percent(value, decimals) {
797+
var globalOptions = this && this.percent ? this.percent : {};
798+
decimals = src_util.exist(decimals) ? decimals : globalOptions.decimalDigits;
799+
decimals = typeof decimals !== 'undefined' ? decimals : 0;
800+
value = value === null || isNaN(value) ? 0 : value;
801+
802+
if (value <= 1) {
803+
return "".concat((value * 100).toFixed(decimals), "%");
804+
}
805+
806+
return "".concat(value.toFixed(decimals), "%");
807+
}
808+
809+
/* harmony default export */ var other_percent = (percent);
783810
// CONCATENATED MODULE: ./src/other/index.js
784811

785812

786813

787814

788815

789816

817+
790818
// CONCATENATED MODULE: ./src/index.js
791819

792820

dist/vue2-filters.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)