diff --git a/app/index.html b/app/index.html index 1720915..e57a03a 100644 --- a/app/index.html +++ b/app/index.html @@ -190,6 +190,7 @@ + diff --git a/app/scripts/filters/percent.js b/app/scripts/filters/percent.js new file mode 100644 index 0000000..87abcfc --- /dev/null +++ b/app/scripts/filters/percent.js @@ -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); + } + }]); +})(); diff --git a/app/views/list.html b/app/views/list.html index 31ee58f..6a5410a 100644 --- a/app/views/list.html +++ b/app/views/list.html @@ -11,7 +11,7 @@ aria-valuenow="{{task.completePercent}}" aria-valuemin="1" aria-valuemax="100" style="width: {{task.completePercent}}%;">
+ ng-bind="(task.completePercent | percent: 2) + '%'">