The value of {{bb}} is "9.00 to 10.00"
I Want to display only 9
The value of {{bb}} is "9.00 to 10.00"
I Want to display only 9
If you want to display only the first character then the simplest is to use [0]
:
{{ bb[0] }}
However, if your goal is to display hour portion of the string then you could do something like this:
{{ bb.split('.')[0] }}
and for 12.00 to 13.00
it would print 12
as expected.
You can use ng-blur
with Math.round
like
ng-blur="number = Math.round(number)"
You can also use filter components in ng / number