How can i get the first two number after 0?

Hi, after trying my best for the past 30 minuits on various site i couldnt fine any answer to my question or something related to this

local number = 0.63448369503021
print(number)

print(math.floor(number))
print(math.round(number))

I dont understand how i can get the first two numbers of my value.

if you want the 0.6 then you can do

local number = 0.63448369503021

number = tostring(number)

number = number:sub(1, 3)

number = tonumber(number)

Thats a lot mate i couldnt continue my project without this!

local number = 0.63448369503021
local hundredths = math.floor((number % 1) * 100) / 100
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.