From 4ecf08b5c5cdc4ddb3a997e2f3a2188e921ff430 Mon Sep 17 00:00:00 2001 From: monikahedman Date: Tue, 11 Feb 2020 19:29:19 -0500 Subject: number jitter fixed --- src/client/views/animationtimeline/Timeline.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx index 2b0525c6e..e9caa2b2a 100644 --- a/src/client/views/animationtimeline/Timeline.tsx +++ b/src/client/views/animationtimeline/Timeline.tsx @@ -329,17 +329,15 @@ export class Timeline extends React.Component { time = time / 1000; const inSeconds = Math.round(time * 100) / 100; - // console.log(inSeconds) - // var inSeconds = parseFloat(time.toFixed(2)); - // const inSeconds = (Math.floor(time) / 1000); const min: (string | number) = Math.floor(inSeconds / 60); - let sec: (string | number) = (Math.round((inSeconds % 60) * 100) / 100); + const sec: (string | number) = (Math.round((inSeconds % 60) * 100) / 100); + let secString = sec.toFixed(2); if (Math.floor(sec / 10) === 0) { - sec = "0" + sec; + secString = "0" + secString; } - // sec = Number.parseFloat(sec).toFixed(2); - return `${min}:${sec}`; + + return `${min}:${secString}`; } -- cgit v1.2.3-70-g09d2