search/
Start typing to search packages!
package_2
numberformat
By @hollower233
Roblox
MirroredNumberFormat
Luau utilities for formatting numbers, currency, and time — and parsing them back into numbers.
A pure-Luau port of @rbxts/formatting (originally written for roblox-ts), rewritten for plain Luau/Wally projects.
Installation
Add to your wally.toml:
[dependencies]
NumberFormat = "hollower233/numberformat@0.1.0"
Then run:
wally install
API
Number formatting
local NumberFormat = require(ReplicatedStorage.Packages.NumberFormat)
NumberFormat.commaFormat(1000000) --> "1,000,000"
NumberFormat.abbreviate(1000000) --> "1M"
NumberFormat.abbreviate(1000000000000000000) --> "1Qt"
NumberFormat.parseAbbreviated("1B") --> 1000000000
commaFormat(n: number | string, minimum: number?, separator: string?, decimal: string?): stringPlaces commas (or a custom separator) between every three digits.abbreviate(n: number, threshold: number?, suffixes: {string}?): stringAbbreviates numbers at or abovethreshold(default1000) using suffixes likeK,M,B, ...parseAbbreviated(suffixed: string, suffixes: {string}?): numberParses a string produced byabbreviate()back into a number.
Time formatting
NumberFormat.toSeconds("10m 20s") --> 620
NumberFormat.toRemainingTime(310) --> "5m 10s"
NumberFormat.toLongRemainingTime(3690) --> "01:01:30"
toSeconds(time: string): numberConverts a time string (e.g."1h 5m") into seconds.toRemainingTime(seconds: number, secondsFormat: string?, minutesFormat: string?, hoursFormat: string?, daysFormat: string?): stringConverts seconds into a short remaining-time string.toLongRemainingTime(seconds: number): stringConverts seconds into anHH:MM:SSstring.
License
MIT
Package Details
Install command (Click to copy)
Version
0.1.2
License
MIT
Safe for commercial use
Automated license review — not legal advice.
