In this question I will actually be asking about two different string manipulation problems I have. Number one:
How can I tell if there is a decimal in a number. Because when I am displaying money on my leaderboard as a string, I want it to display the first three digits along with the decimal. I tried using string.sub(mValue, 1, 3) but that counted the decimal in the string. Please help me out with this issue. Second:
I have a admin script that I am writing for fun and wanted to shorten the length of an if statement. Here is the code:
plr.Chatted:Connect(function(msg)
if string.lower(string.sub(msg, 1, 5)) == "speed" then
if type(string.sub(msg, 7, 9)) == "Integer" or then -- here is my problem I want it to check if after a space after speed if it is a two digit or three digit number. However that would require a really long if statement is there an easier way to manipulate this?
end
end
end)
Hope you guys can help. Thanks!

4 comments
One thing is I don't know if "Interger" exist in type.
Of course not. I wrote Integer. Not Interger. Lol
I found that using
Number:match('%d%d%d[.^]')will do the trick: If it has 3 numbers and a period, then it'll return return the first 3 numbers and then a period, otherwise it'll return nil.I meant the decimal wherever it appears in the number