JSFiddle - React, Tailwind, and code Playground
by francisstalin
HTML
<script src="http://code.angularjs.org/1.0.0rc4/angular-1.0.0rc4.min.js"></script>
<div ng:app="myApp">
<div ng-controller="decimalCntl">
<div>{{number | decimalConvertion:5}}</div>
</div>
</div>
JavaScript
angular.module('myApp',[]).filter('decimalConvertion', function(){
return function(str, max){
function pad(str, max){
str = str.toString();
return str.length < max ? pad("0" + str, max) : str;
}
return pad(str,8);
};
});
angular.module('guest').controller('home_list', ['$scope', function($scope, $http) {
}]);
function decimalCntl($scope) {
$scope.number=5;
}