Here is my HTML:
<div ng-controller = "myCntrl">
<pre>floor 1: {{Math.floor( value ) }}</pre>
<pre>floor 2: {{value }}</pre>
<pre>floor 3: {{value | number : 0 }}</pre>
<pre>floor 1 from controller: {{newValue }}</pre>
</div>
Controller
app.controller('myCntrl', function ($scope) {
$scope.value = 1233.8435;
$scope.newValue = Math.floor(1233.8435);
});
The output:
floor 1:
floor 2: 1233.8435
floor 3: 1,234
floor 1 from controller: 1233
Generally I'm looking for the proper way to get 1233
.
I don't want to invoke new method in controller.
Why Math.floor
returns nothing?
Thanks,
Demo Fiddle