I’m doing a really basic progress percentage calculation, at the moment it’s a linear calculation so:
0 -> 0%
max/10 -> 10%
max -> 100%
The calculation is simply like this:
$max = 4000;
$current = 1450;
$percent = ceil($current/$max*100);
Easy as.
but I need it to make it look as if the progress bar increases quicker at the beginning, basically boosting the initial visual progress.
I really should know that but my brain isn’t retrieving way old maths (I blame too much coffee).
I guess it’s a kind of easing I’m after; how can I change this – very simple – formula to have a different affect on the progression curve?
Note: That’s php obviously, but that should be the same in any language.
You can use a quadratic adjustment with a small parameter (
$sf).This is the same as yours for
$sf=0. However you can tweak $sf to get the behavior you want.