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