0

The value of {{bb}} is "9.00 to 10.00"

I Want to display only 9

Gopinath Kaliappan
  • 6,929
  • 8
  • 37
  • 60

2 Answers2

2

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.

dfsq
  • 191,768
  • 25
  • 236
  • 258
1

You can use ng-blur with Math.round like

ng-blur="number = Math.round(number)"

You can also use filter components in ng / number

Tushar Gupta
  • 15,504
  • 1
  • 29
  • 47