Eclipse’s Abbreviation Module – Quick Number Formatting

Hey everyone!

I made Eclipse’s Abbreviation Module to make number formatting in Roblox games easier. It’s simple, lightweight, and works great for things like leaderboards, tycoons, and simulators.

It can format numbers in four styles:

  • Short: 1.2K / 5.4M / 1.2B
  • Comma: 1,000,000
  • Dot: 1.000.000
  • Space: 1 000 000

Usage is really simple — just require the module and pick your format.

I originally made it to make game development faster, but it wasn’t quite enough for Eclipse’s Utility Modules v3. Still, it’s perfect for smaller projects or when you just need a quick, clean number formatter.


Module Info:

Name: Eclipse’s Abbreviation Module
Type: ModuleScript
Formats: short / comma / dot / space
Developer: Eclipse
Discord: Join here
Marketplace Link: Eclipse’s Abbreviation Module


Quick Example:

local NumberFormatter = require(game.ReplicatedStorage.EclipseAbbreviationModule)

print(NumberFormatter.ToShort(15320))      --> 15.3K
print(NumberFormatter.ToComma(1000000))    --> 1,000,000
print(NumberFormatter.Format(1234567, "dot"))  --> 1.234.567

It’s lightweight, easy to drop in, and works out-of-the-box.

Would love to hear any feedback, ideas, or suggestions!

2 Likes

You’ve made some overworking here.

Also precision loss at negative floating points with ToComma and etc. methods.
Also making a new suffix will be very costy in terms of memory consumption and CPU time consumption. Instead of tables, you should just store a suffixes string (“KMBTQ”).
image

P.S. I wouldn’t made this reply if it wasn’t labeled as “quick” and “lightweight”. And the benchmarking was firing localised functions for both implementations of formatting, so the indexing overhead is not present in both benchmarks.

(About better implementation’s ToDot and alike methods, they’re are about 10% faster at best, but overall they give the same perfomance, yet they gain ability to show float numbers correctly.)

1 Like

Thanks for your feedback, I’ll definitely keep these things in mind working on more modules.
As for this module, i’ll just keep it for now. I might change it when i got some free time.

1 Like