Issue
How to perform an integer division in Angular2 expression? I know there is number:0 filter but it transforms to the closest full number and I want to just get rid of the fraction. Like:
{{100/60}}
Displaying just 1.
Solution
yes, there is a way. It will return you the whole number, the opposite of modulo %
{{ (x / y) - (( x % y ) / y) }}
this will display what you want without pipes or functions or anything extra
Answered By - mast3rd3mon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.