1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Check if the float is quals (abs value is greather 0.01) and return the sub value when not.

This commit is contained in:
David Dreher
2019-03-25 06:25:44 +01:00
committed by Junyoung Choi
parent 19fc1fd674
commit 2cbbe7aeda

View File

@@ -41,10 +41,8 @@ function sortByAlphabetical (a, b) {
const floatA = parseFloat(matchA[1]) const floatA = parseFloat(matchA[1])
const floatB = parseFloat(matchB[1]) const floatB = parseFloat(matchB[1])
if (floatA < floatB) { if (Math.abs(floatA - floatB) > 0.01) {
return -1 return floatA - floatB
} else if (floatA > floatB) {
return 1
} }
// The float values are equal. We will compare the full title. // The float values are equal. We will compare the full title.