From 2cbbe7aeda61a17d52ece8538f6c8cf73f0a8e61 Mon Sep 17 00:00:00 2001 From: David Dreher Date: Mon, 25 Mar 2019 06:25:44 +0100 Subject: [PATCH] Check if the float is quals (abs value is greather 0.01) and return the sub value when not. --- browser/main/NoteList/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index e83acad4..c12b9977 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -41,10 +41,8 @@ function sortByAlphabetical (a, b) { const floatA = parseFloat(matchA[1]) const floatB = parseFloat(matchB[1]) - if (floatA < floatB) { - return -1 - } else if (floatA > floatB) { - return 1 + if (Math.abs(floatA - floatB) > 0.01) { + return floatA - floatB } // The float values are equal. We will compare the full title.