asherppan
(concat_nate)
October 26, 2024, 4:39am
#1
It’s currently really hard to read modules like this and can get confusing, it’d be nice if there could be a little abbreviation of the number that uses the same logic Roblox does to leaderstat values (1000000 → 1M, etc) when you hover your mouse over a number in the script editor.
(Roblox could do this with something like this:
1 Like
nuttolum
(nut)
October 26, 2024, 5:27am
#2
not exactly the same but lua supports scientific notation, so you can write 1e3 instead of 1000 for example
2 Likes
Judgy_Oreo
(DisplayName)
October 26, 2024, 6:16am
#3
Underscores can be used:
local OneMillion = 1000000
-- Or...
local OneMillion = 1_000_000
(Link )
Yesterday I heard from a developer on youtube that you can use underscores to make large numbers more understandable and readable.
Example:
local num = 1_000_000_00
print(num) -- 100000000
I doubt this will work though, but you can try it. I haven’t tested it out myself.
If it didn’t work, then maybe add a comment next to every number?
Req = 1000000 -- One million
Req = 25000000000 -- Twenty-five billion
Req = 100000000000 -- One hundred billion
Katrist
(Katrist)
October 26, 2024, 6:40am
#5
It does work if anyone is wondering.
1 Like
12345koip
(12345koip)
October 26, 2024, 7:25am
#6
You could always try writing it in exponential form, like this:
local num = 100000
local num = 1e5