View Single Post
05/29/23, 08:21 PM   #9
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
Originally Posted by Sharlikran View Post
I really recommend against mixing formats like that. Anything can be stored at a number like 10000 or 1000 anywhere you want. For a table for LibAddonMenu, in the saved variables, anything. When displaying the number then use the zo_xxx function. Otherwise you will be going back and forth all over the place. For example comparing 10,000 vs 10000 and so on.

Another thing though is if the value is not going to change then use a constant

local YOURMODNAME_VALUE_TEN_THOUSAND = 10000
Code:
choices = {"0", "100", "1,000", ZO_LocalizeDecimalNumber(YOURMODNAME_VALUE_TEN_THOUSAND) },
choicesValues= {"0", "100", "1,000", YOURMODNAME_VALUE_TEN_THOUSAND },
I'm happy to store it as 10000 because I use it in other functions mathematically. Im merely trying to display it in 10,000 format in a libaddonmenu dropdown list. The problem is it then uses the selected value to save it again. So I'm trying to display in panel like this 10,000 and then convert back to 10000 after selected. I think my hurdle atm is HOW to display 10,000 in the "choices" without it going wonky from all the extra commas and have whats there ONLy save the number not the function as well to the variable.

Ive currently left it as 10000 everywhere and working fine. Just looks like crap in the settings imo.
  Reply With Quote