I'm looking for an algorithm to return a number of 100 parts per point.
For example, if the part is between 1 and 100 then it returns 1. If this part is between 101 and 200 then it should be returned 2. The final example, if the part is 357, then it should return 4.
A simple division will not work and tried modules but can not find it to answer me right Can anyone help me with it?
You can divide by just 100 and limit the value.
Which language are you using?
PHP Example: $ part = ceil ($ number / 100);
Comments
Post a Comment