wip
This commit is contained in:
1 parent
2bb7fdbc27
commit
852ed58c70
1 file changed
+5
-2
@@ -21,8 +21,11 @@ function animate(element, end, duration = 500, fixtotwo = false) {
|
||||
// Calculate current value and round to integer
|
||||
const currentCount = Math.round(end * easedProgress * 100) / 100;
|
||||
|
||||
if (fixtotwo) element.innerHTML = currentCount.toFixed(2);
|
||||
else element.innerHTML = currentCount;
|
||||
if (fixtotwo) {
|
||||
element.innerHTML = currentCount.toFixed(2);
|
||||
} else {
|
||||
element.innerHTML = currentCount;
|
||||
}
|
||||
|
||||
if (progress < 1) {
|
||||
requestAnimationFrame(updateCount);
|
||||
|
||||
Reference in new issue
Block a user