AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to properly divide two values into float x.x (https://forums.alliedmods.net/showthread.php?t=313329)

TheBladerX 01-05-2019 12:14

How to properly divide two values into float x.x
 
Hello, how do I properly divide doswiadczenie_gracza[id] / doswiadczenie_poziomu[poziom_gracza[id]] ? It should get output value like x.x%.
Thank you.

Bugsy 01-05-2019 12:17

Re: How to properly divide two values into float x.x
 
You can format it any way you want. Just make sure the value you are formatting is a float. If both variables are already floats then you are good. If they are integers, I would do new Float:fResult = float( 1 ) / float( 2 )

Try %0.1f%%

TheBladerX 01-05-2019 14:14

Re: How to properly divide two values into float x.x
 
Got it! Thank you many times!


All times are GMT -4. The time now is 07:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.