Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> </head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script> <body> <div ng-app="myApp" ng-controller="numberCtrl"> <h1> Wikitechy number filter in AngularJS </h1> <h3> The original number : {{value}} </h3> <h3>Default formatting: {{ value | number}}</h3> <h3>No fractions : {{ value | number: 0 }} </h3> <h3>Negative number: {{ -value | number:4 }} </h3> </div> <script> var app = angular.module('myApp', []); app.controller('numberCtrl', function($scope) { $scope.value = 2312.9117; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.