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:
committed by
Junyoung Choi
parent
19fc1fd674
commit
2cbbe7aeda
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user