From 4278c26eedb07babb45a0529fa1066274a9343be Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Mon, 4 Mar 2024 18:28:42 +0300 Subject: [PATCH] fix: apply edits --- lib/static/components/state/index.jsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/static/components/state/index.jsx b/lib/static/components/state/index.jsx index 1fc61bad1..ce7dcaba1 100644 --- a/lib/static/components/state/index.jsx +++ b/lib/static/components/state/index.jsx @@ -127,18 +127,14 @@ class State extends Component { _getDisplayedDiffPercentValue() { const percent = this.props.image.diffRatio * 100; - const percentThreshold = 0.001; - const percentString = String(percent); + const percentRounded = Math.ceil(percent * 100) / 100; + const percentThreshold = 0.01; if (percent < percentThreshold) { return `< ${percentThreshold}` } - - if (percent > 1) { - return percentString.slice(0, 4); - } - - return percentString.slice(0, 5); + + return String(percentRounded); } _getStateTitleWithDiffCount() {