<center> <div ng-app="simpleProgram"> <input type="number" ng-model="a" autofocus="autofocus" style="width:100px; text-align:center; font-size:18px;" step="1" min="0"/> <br /> <input type="number" ng-model="b" style="width:100px; text-align:center; font-size:18px;" step="1" min="0" /> <br /> <input type="number" ng-model="c" style="width:100px; text-align:center; font-size:18px;" step="1" min="0" /> <br /> <input type="number" ng-model="d" style="width:100px; text-align:center; font-size:18px;" step="1" min="0" /> <br /> <input type="number" ng-model="e" style="width:100px; text-align:center; font-size:18px;" step="1" min="0" /> <br /> <br /> <br /> </div> </center>
<script> var app = angular.module('simpleProgram', []); app.filter('singleDecimal', function ($filter) { return function (input) { if (isNaN(input)) return input; return Math.round(input * 10) / 10; }; }); app.filter('setDecimal', function ($filter) { return function (input, places) { if (isNaN(input)) return input; var factor = "1" + Array(+(places > 0 && places + 1)).join("0"); return Math.round(input * factor) / factor; }; }); app.controller('Ctrl', function ($scope) { $scope.val = 1.56; }); </script>
<style type="text/css"> p { color:blue; display: inline-block; font-family: monospace; font-style: bold; font-size:18px; } input { display: inline-block; } </style>