Skip to content

Commit 28fbfdb

Browse files
committed
wip(web): round tweened totals so decimals never flash during the pricing animation
1 parent f04e3d6 commit 28fbfdb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/content/en/enterprise-pricing-calculator.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,8 @@ <h3 id="shareTitle" data-i="share.h"></h3>
10981098
function step(now){
10991099
const k = Math.min(1,(now-t0)/dur), e = 1-Math.pow(1-k,3);
11001100
shownTotal = from + (to-from)*e;
1101-
el.textContent = fmt(shownTotal);
1101+
/* round while animating so interpolated decimals never flash */
1102+
el.textContent = fmt(Math.round(shownTotal));
11021103
if(k<1) requestAnimationFrame(step); else { shownTotal = to; el.textContent = fmt(to); }
11031104
}
11041105
requestAnimationFrame(step);

0 commit comments

Comments
 (0)