From b0f4fadb7b62297b6dbd574b2a7d8eee0f990eb4 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Mar 2014 22:15:52 +0000 Subject: Fix sort by filesize in logfiles/status --- logfiles-status-html.lsp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'logfiles-status-html.lsp') diff --git a/logfiles-status-html.lsp b/logfiles-status-html.lsp index a8282bf..bd45435 100644 --- a/logfiles-status-html.lsp +++ b/logfiles-status-html.lsp @@ -2,6 +2,20 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> +<% +function convertsize(size) + if string.find(size, "k$") then + 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.0 * 1024.0 * 1024.0 + else + return tonumber(string.match(size, "[%d.]*")) + end +end +%> +