How can i make textbox numbers more visible

heres the problem, when the player puts a number in the text box it becomes
“1234567890”
instead i want it to be
“1,234B”

heres my script that only allows numbers in the text box

script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
	
	script.Parent.Text = script.Parent.Text:gsub('%D+', '');	

end)

there is a module which allows you to format huge numbers and make them more visible

you can check out their API

thanks for the help, but i know the module its just that i dont know how to interpert it into the textbox when the player changes the value.

When the player puts 123 which is in a hundreds value it shows a thousands like this 123K

script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
    local text = script.Parent.Text:gsub('%D+', '')
    local formattedText = text:reverse():gsub("(%d%d%d)", "%1,"):reverse()
    formattedText = formattedText:gsub("^,", "")
    script.Parent.Text = formattedText .. "B"
end)

This script will remove any non-digit characters from the text, then add commas as thousands separators, and finally add a “B” at the end.

1 Like