Raised This Month: $51 Target: $400
 12% 

How to properly divide two values into float x.x


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 01-05-2019 , 12:14   How to properly divide two values into float x.x
Reply With Quote #1

Hello, how do I properly divide doswiadczenie_gracza[id] / doswiadczenie_poziomu[poziom_gracza[id]] ? It should get output value like x.x%.
Thank you.
TheBladerX is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-05-2019 , 12:17   Re: How to properly divide two values into float x.x
Reply With Quote #2

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%%
__________________

Last edited by Bugsy; 01-05-2019 at 12:18.
Bugsy is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 01-05-2019 , 14:14   Re: How to properly divide two values into float x.x
Reply With Quote #3

Got it! Thank you many times!
TheBladerX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:28.


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