fix the value of completed percent is wrong
This commit is contained in:
parent
32e9959d0d
commit
caf1fda198
|
@ -190,6 +190,7 @@
|
|||
<script src="scripts/controllers/main.js"></script>
|
||||
<script src="scripts/controllers/settings-ariang.js"></script>
|
||||
<script src="scripts/filters/dateDuration.js"></script>
|
||||
<script src="scripts/filters/percent.js"></script>
|
||||
<script src="scripts/filters/substring.js"></script>
|
||||
<script src="scripts/filters/taskOrderBy.js"></script>
|
||||
<script src="scripts/filters/volumn.js"></script>
|
||||
|
|
12
app/scripts/filters/percent.js
Normal file
12
app/scripts/filters/percent.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module("ariaNg").filter('percent', ['numberFilter', function (numberFilter) {
|
||||
return function (value, precision) {
|
||||
var ratio = Math.pow(10, precision);
|
||||
var result = parseInt(value * ratio) / ratio;
|
||||
|
||||
return numberFilter(result, precision);
|
||||
}
|
||||
}]);
|
||||
})();
|
|
@ -11,7 +11,7 @@
|
|||
aria-valuenow="{{task.completePercent}}" aria-valuemin="1"
|
||||
aria-valuemax="100" style="width: {{task.completePercent}}%;">
|
||||
<div ng-class="{'lower': task.completePercent < 50}"
|
||||
ng-bind="(task.completePercent | number: 2) + '%'"></div>
|
||||
ng-bind="(task.completePercent | percent: 2) + '%'"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
|
Reference in a new issue