From d77bf9609380d27301abeba31e467039517cb8d5 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 5 Feb 2014 19:56:42 +0000 Subject: Fix issues with tablesorter sorting --- weblog-listfiles-html.lsp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'weblog-listfiles-html.lsp') diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index 673afa8..ea2ab2c 100644 --- a/weblog-listfiles-html.lsp +++ b/weblog-listfiles-html.lsp @@ -6,13 +6,13 @@ html = require("acf.html") <% function convertsize(size) if string.find(size, "k$") then - return tonumber(string.match(size, "%d*")) * 1024 - elseif string.find(string.match(size, "%d*"), "M$") then - return tonumber(size) * 1024 * 1024 + return tonumber(string.match(size, "[%d.]*")) * 1024.0 + elseif string.find(size, "M$") then + return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 elseif string.find(size, "G$") then - return tonumber(string.match(size, "%d*")) + 1024 * 1024 * 1024 + return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 else - return tonumber(size) + return tonumber(string.match(size, "[%d.]*")) end end %> -- cgit v1.2.3