How can I calculate percentages?

The title is the question. How can I calculate percentages?

So basically I want to do 4042 of 10000 in LuaU. How?

Thanks in advance! Thanks, WE

1 Like

Say x=4042 and y=10000

Percentage would be 100*(x/y)



local ContentProvider: ContentProvider = game:GetService("ContentProvider")
local AllAssets: number = ContentProvider.RequestQueueSize

while true do
	print(100 * (ContentProvider.RequestQueueSize/AllAssets))

It doesn’t seem to work.

That’s really strange; tested it myself and it worked as expected (I copied and pasted your code).

Can you print the RequestQueueSize and AllAssets separately (or please do print(ContentProvider.RequestQueueSize, AllAssets) so I can see what the values of them are?

Then please show a screenshot of the output

It appears to work in a game that has assets in it.