Math functions in angular2 bindings
You can try this :
@Component({
selector: 'my-app',
template: `
<div>
<h2>Hello {{math.round(number)}}</h2>
</div>
`,
})
export class App {
number = 2.5;
math = Math;
}
DEMO
For rounding numbers in Angular templates, you can use the DecimalPipe: {{ value | number }}
See all the rounding options in https://angular.io/api/common/DecimalPipe
For all the built-in pipes, check https://angular.io/api?type=pipe