From d051bf48fb53481082b12a6778e7c7863f1979ca Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 23 Apr 2014 16:12:07 +0000 Subject: Changes to use new htmlviewfunctions functions --- provisioning-listtemplates-html.lsp | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'provisioning-listtemplates-html.lsp') diff --git a/provisioning-listtemplates-html.lsp b/provisioning-listtemplates-html.lsp index ee67b17..a649bec 100644 --- a/provisioning-listtemplates-html.lsp +++ b/provisioning-listtemplates-html.lsp @@ -3,6 +3,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 +%> +