Raised This Month: $ Target: $400
 0% 

Question about percentage calculation.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-07-2012 , 10:42   Question about percentage calculation.
Reply With Quote #1

Hello, I want to make a HUD message which looks like that:

>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<

I have 2 variables, but I can't think of how exactly I can do it to show the percent of each variable (depending on the sum of them).
I have tried different ways buy I couldn't do it exactly as I want.

When they have the same value, then it should be 50%-50% and the HUD should look like the one above.

When they are 75%-50% the HUD should look like:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<

When they are 100%-0% it should be:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

99%-1%:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><

And so on...

The HUD must be always 40 characters.
The variables are integer numbers.

How exactly can I do this?
__________________

Last edited by <VeCo>; 05-07-2012 at 10:48.
<VeCo> is offline
 


Thread Tools
Display Modes

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 00:28.


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