From 6c70e4e731dd8342e4ce078f150d4d2113f5643c Mon Sep 17 00:00:00 2001 From: 08draven Date: Sun, 27 Oct 2024 14:56:46 -0400 Subject: [PATCH] fix sql sorting --- game.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game.js b/game.js index ac616de..14c105d 100644 --- a/game.js +++ b/game.js @@ -15,8 +15,10 @@ class Game extends GameBasic { this.ws = []; } async updateLeaderboard() { - let jason = await db.all('SELECT * FROM stats ORDER BY ko DESC LIMIT 100'); + let jason = await db.all('SELECT * FROM stats ORDER BY CAST(ko AS REAL) DESC LIMIT 100'); + console.log(jason) + let scoresOld = this.scores || []; let scores = {};