NumeralModule [BETA]

I recently created a quick module that can add commas to numbers (ex. 1000 :arrow_right: 1,000), and abbreviate numbers (ex. 1000 :arrow_right: 1k). This is currently a small module but will be expanded in the future with more functions and no limits! (because the max number you can use in the module currently is 1^12 (1 trillion))

Here is the link if you want to try it out:

Please report any bugs below!

Lua examples:

module:AddCommasToNumber(number)

local module = require(game.ReplicatedStorage.NumeralModule)
module:AddCommasToNumber(100000) -- returns 100,000

module:AbbreivateNumber(number)

local module = require(game.ReplicatedStorage.NumeralModule)
AbbreiviateNumber(7775484864) -- returns 7.7b
9 Likes

Hey this could be pretty helpfull, Thanks for the resource!

But, Isn’t there a better way instead of using a ton of if statements?


(I am not sure if there is but there probably is)
I recommend looking at miner’s haven by @berezaa, It has a number module that does pretty much the same, But without a ton of if statements.

Either way i will still use this, And i can’t wait to see how you improve/update this!

2 Likes

Hey,

Actually There is

Take a look on this website: lua-users wiki: Formatting Numbers

1 Like