How can I get a decimal from a string

I am trying to get a decimal from a message but when I try I always get a number. How can I get a decimal from the string.
My code:

	elseif  string.find(string.lower(msg), "wait") and string.gsub(msg, "%D", "") then
		WaitTime = tonumber(string.gsub(msg, "%D", ""))

The ‘math’ library has a built-in function for this.

local piIntegral, piDecimal = math.modf(math.pi)
print(piIntegral, piDecimal) --3 0.14...
1 Like