From 29ac212938085c7cc97e9a6036ccdc629af72359 Mon Sep 17 00:00:00 2001 From: Dylan Sheffer Date: Tue, 31 Oct 2017 10:38:04 -0400 Subject: [PATCH] Removed unneeded files --- Utility.lua | 75 +---------------------------------------------------- config.xml | 4 +-- 2 files changed, 3 insertions(+), 76 deletions(-) diff --git a/Utility.lua b/Utility.lua index 9a9f961..1c8901d 100644 --- a/Utility.lua +++ b/Utility.lua @@ -218,78 +218,6 @@ local function URLEncode(s) return fieldValue; end - -- from sam_lie - -- Compatible with Lua 5.0 and 5.1. - -- Disclaimer : use at own risk especially for hedge fund reports :-) - ---============================================================ - -- add comma to separate thousands - -- - local function comma_value(amount) - local formatted = amount - while true do - formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') - if (k==0) then - break - end - end - return formatted - end - - ---============================================================ - -- rounds a number to the nearest decimal places - -- - local function round(val, decimal) - if (decimal) then - return math.floor( (val * 10^decimal) + 0.5) / (10^decimal) - else - return math.floor(val+0.5) - end - end - - --=================================================================== - -- given a numeric value formats output with comma to separate thousands - -- and rounded to given decimal places - -- - -- - local function format_num(amount, decimal, prefix, neg_prefix) - Log("[Utility.format_num] "); - - local str_amount, formatted, famount, remain - - decimal = decimal or 2 -- default 2 decimal places - neg_prefix = neg_prefix or "-" -- default negative sign - - famount = math.abs(round(amount,decimal)) - famount = math.floor(famount) - - remain = round(math.abs(amount) - famount, decimal) - - -- comma to separate the thousands - formatted = comma_value(famount) - - -- attach the decimal portion - if (decimal > 0) then - remain = string.sub(tostring(remain),3) - formatted = formatted .. "." .. remain .. - string.rep("0", decimal - string.len(remain)) - end - - -- attach prefix string e.g '$' - formatted = (prefix or "") .. formatted; - - -- if value is negative then format accordingly - if (amount < 0) then - if (neg_prefix=="()") then - formatted = "("..formatted ..")" - else - formatted = neg_prefix .. formatted - end - end - - return formatted; - end - - UtilityInternal.Trim = Trim; UtilityInternal.IsType = IsType; UtilityInternal.Log = Log; @@ -299,5 +227,4 @@ local function URLEncode(s) UtilityInternal.CreateQueryString = CreateQueryString; UtilityInternal.GetXmlChildValue = GetChildValue; UtilityInternal.GetXmlNodeCount = GetNodeCount; - UtilityInternal.FormatNumber = format_num; - UtilityInternal.RemoveTrailingSpecialCharacters = RemoveTrailingSpecialCharacters; + UtilityInternal.RemoveTrailingSpecialCharacters = RemoveTrailingSpecialCharacters; diff --git a/config.xml b/config.xml index ebd279a..47edf3b 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ Alma Barcode Lookup Atlas Systems, Inc. - 1.0 + 1.0.1 true Addon Performs an Alma Item lookup with the item's barcode and imports the results. @@ -36,4 +36,4 @@ AlmaApi.lua AlmaLookup.lua - + \ No newline at end of file