Honestly, I can’t figure out what to look for, but what I tried did not give any results, so I apologize if it is already asked.
This is also a more mathematical question than a programming question, but I do it in JavaScript, and it seemed pretty suitable.
What I want to do is reduce the number, the higher. For example, 10 can be reduced to 9, and 100 can be reduced to 20. I tried using the number and division itself, but obviously this just returns a fixed number. I also tried simple separation, but all of this reduced the amount too much and had little effect on higher numbers in comparison. Is there any formula for this using a JavaScript Math object?
source
share