I want a script function to delete last digit from an value. Just one last in the text string or numbervalue. I'm not sure what functions i need to make smth like that. It's hard to find anything in developer.roblox.com I use as main function MouseButton1Click cause it will run when clicked a button.
script.Parent.MouseButton1Click:connect(function(buy) --[[C clear and save]]
local mem = script.Parent.Parent.Parent.HDDMEM
local butt = script.Parent.Parent.Parent.Memory.Buttons
-[[there i need that function]]
wait(0.01)
end)
Thanks for every help. /EDIT "Are you trying to remove a digit itself or just -1 from the value?" Read my questions once again until you get it.

9 comments
use :Connect(), :connect() is deprecated
Are you trying to remove a digit itself or just -1 from the value?
In order to remove last the last digit from a value, do this: local val = 15; val = math.floor(val / 10)
It doesn't work SaltyIceberg but i may not understand what you want to tell me. I'm gonna learn using this math.floor function but it's hard without working script that use this function.
If the value is a string, then this may help https://developer.roblox.com/en-us/api-reference/lua-docs/string. If you don't understand it well, search for tutorials related to strings.
Also, if it's a number, use "tostring()" to make the number a string, remove last digit, use "tonumber()" and there you go.
you can use this for numbers math.floor(Value/10)*10 or this for strings string.sub(1,#Text-1)
IDK I wrote a comment a second time and, it didn't show on the question page. What's wrong with your scripting helpers
Whatever. Seems I already did what did I want. So thanks.