screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="myController"> <h1>AngularJS Round Two Decimal Places</h1> <p>Original number: {{ numberValue }}</p> <p>Number with 2 decimal places: {{roundedNumber }}</p> </div> <script> var app = angular.module("myApp", []); app.controller("myController", function ($scope) { $scope.numberValue = 4456.2543; $scope.roundedNumber = $scope.numberValue.toFixed(2); }); </script> </body> </html>