1
I would like to make a "rounding" of values within javascript.
I know the function Math.Round()
round, but only decimal, I need the following situations.
1 - From 10 to 10... If the user type 155, the system rounds to 160, If the user type 152 for example, the system rounds to 150.
2 - From 500 to 500... If the user enters 4300, the system rounds to 4500, if the user type 4220, the system rounds to 4000
I honestly have no idea how to do this.
Thanks in advance
Do you have any code made? The logic that could be used is by division rest. Divide the number and multiply by the quantity times that the division without rest is possible.
– Renato Junior
Actually no... I couldn’t think of a reasoning for this
– gabrielfalieri
What is the condition to distinguish between the two situations: when to use rule 1 and when to use rule 2?
– Woss
It is by choosing the type of software licensing. Educational from 500 to 500 and Commercial and Professional from 10 to 10
– gabrielfalieri