I need a math function / formula / expression to take a number as a parameter and find the smallest number ending in specific digits that are larger than the parameter.
For example, if the final digits should be 88, these are some examples of what I want:
f(0) = 0 f(87) = 88 f(88) = 88 f(89) = 188
etc. You get the idea.
So far I have used a function (in Delphi not implemented by me) that does this:
function RoundToSpecificEndingDigits(aLength,aModMeasure : double) : double; begin Result := aModMeasure; while Result < aLength do Result := Result + 100; end;
Now I need a more “mathematical” approach with div and mods and rounds, etc. The reason is because I want to do this in SQL without creating functions.
source share