0
Q:

how to round numbers roblox studio

local roundDecimals = function(num, places) --num is your number or value and places is number of decimal places, in your case you would need 2
    
    places = math.pow(10, places or 0)
    num = num * places
   
    if num >= 0 then 
        num = math.floor(num + 0.5) 
    else 
        num = math.ceil(num - 0.5) 
    end
    
    return num / places
    
end

print(roundDecimals(142.165, 2)) --> 142.17
1
player.PlayerGui.Stats.Frame.Upgrades.UpgradeSpeed.Text = math.floor((player.Stats.Speed.Value / 100)) * 100
0
local Number = 0  -- put your number here
TextLabel.Text = string.format('%.2f%% of Speed', Number)
0

New to Communities?

Join the community