Answer the question
In order to leave comments, you need to log in
How to round a number to tenths in Angular?
A number is fed to the function, divided by the number of users entered, and substituted into another field.
For example, we give 1570, divide by 2 people, we get 785.
How to round up so that 785 becomes 790?
I'm trying to do it through round, Math.round. Doesn't round, but doesn't throw errors either.
Why is this code not working?
$scope.onUserAmountChange = function($summ) {
$scope.model.price = Math.round(($summ / $scope.model.amount_users), -1);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question