Number Abbreviation in Script Editor

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.

image

(Roblox could do this with something like this:
image

1 Like

not exactly the same but lua supports scientific notation, so you can write 1e3 instead of 1000 for example

2 Likes

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

It does work if anyone is wondering.

1 Like

You could always try writing it in exponential form, like this:

local num = 100000
local num = 1e5