From 2f307b8fa7615e2bcfce055e19db65127f84c94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Tue, 22 Nov 2022 18:30:04 +0100 Subject: [PATCH] Add seperator option to GetMoney --- Libs/zzHelper/zzHelper.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Libs/zzHelper/zzHelper.lua b/Libs/zzHelper/zzHelper.lua index 7bb7892..8870c7c 100755 --- a/Libs/zzHelper/zzHelper.lua +++ b/Libs/zzHelper/zzHelper.lua @@ -1,4 +1,4 @@ -local lib = LibStub:NewLibrary("zzHelper", 3) +local lib = LibStub:NewLibrary("zzHelper", 4) if not lib then return end lib['targets'] = lib['targets'] or {} local mixins = {'colorize', 'round', 'sortArray', 'IsTwink', 'classcolor', 'MoneyString', 'MoneyStringSetString', 'MoneyStringSetSize'} @@ -34,7 +34,7 @@ function lib:MoneyStringSetSize(size) iconSize = size end end -function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size) +function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size, seperate) local iconSize = size or iconSize local goldicon = noicon and (noiconcolor and moneyText['goldColor'] or moneyText['gold']) or format(iconbase, 'Gold', iconSize, iconSize) local silvericon = noicon and (noiconcolor and moneyText['silverColor'] or moneyText['silver']) or format(iconbase, 'Silver', iconSize, iconSize) @@ -66,6 +66,9 @@ function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size end if(money > 0) then if(g>0) then + if(seperate) then + g = BreakUpLargeNumbers(g) + end moneystring = format("%s%s%s", color and lib:colorize(g, neg and "ff0000" or "44dd44") or g,abrev, goldicon) end if(s>0) then