I tried.
game.Players.PlayerAdded:Connect(function(plr)
local FormatNumber = require(game.Workspace.FormatNumber.Main)
local formatter = FormatNumber.NumberFormatter.with()
local robux = plr:WaitForChild("Values"):WaitForChild("Robux") -- Change to your currency name
local displayRobux = plr:WaitForChild("leaderstats"):WaitForChild(" Robux")
-- Add your abbreviations/compact notation suffixes here
local abbreviations = FormatNumber.Notation.compactWithSuffixThousands({
"K", "M", "B", "T", "aa", "ab", "ac", "ad", "ae", "af", "ag", "ah", "ai", "aj", "ak", 'al', "am",
"an", "ao", "ap", "aq", "ar", "as", "at", "au", "av", "aw", "ax", "ay", "az", "ba", "bb", "bc", "bd",
"be", "bf", "bg", "bh", "bi", "bj", "bk", "bl", "bm", "bn", "bo", "bp", "bq", "br", "bs", "bt", "bu", "bv",
"bw", "bx", "by", "bz", "ca", "cb", "cc", "cd", "ce", "cf", "cg", "ch", "ci", "cj", "ck", "cl", "cm", "cn",
"co", "cp", "cr", "cs", "ct", "cu", "cv", "cw", "cx", "cy", "cz", "da", "db", "dc", "dd", "de", "df", "dg", "dh", "di",
"dj", "dk", "dl", "dm", "dn", "do", "dp", "dq", "dr", "ds", "dt" -- Change these to whatever formats you want
})
local formatter = FormatNumber.NumberFormatter.with()
:Notation(abbreviations)
-- Round to whichever results in longest out of integer and 3 significant digits.
-- 1.23K 12.3K 123K 4.56T 45.6T 456T 7.89ag 78.9ag 789ag
-- If you prefer rounding to certain decimal places change it to something like Precision.maxFraction(1) to round it to 1 decimal place
:Precision(FormatNumber.Precision.integer():WithMinDigits(3))
local text = formatter:Format(robux.Value)
displayRobux.Value = text
plr.PlayerGui.Game.RobuxBackground.RobuxDisplay.Text = ""..text - error
robux.Changed:Connect(function()
local text = formatter:Format(robux.Value)
displayRobux.Value = text
plr.PlayerGui.Game.RobuxBackground.RobuxDisplay.Text = ""..text -- error
end)
end)
It gave me error: Game is not a valid member of PlayerGui "Players.ElectricPeaPvZ.PlayerGui"