SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 19/12/2009, 05:33 PM   #1
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 318
Reputation: 0
Default Per cent calculation

Hi, i've tried with several methods but i've NEVER to calculate a percentage on SAMP. For example if I want to find 30% of 15 i find 0.

Here is one of the method I used:
pawn Code:
new Float: caution = CarInfo[car][cPrice]*0.3;
printf("%d. %0.1f.", CarInfo[car][cPrice], floatround(caution)); //cPrice = 15 and floatround(caution) = 0 where it should be 4.5

Any help?
Coicatak 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time calculation pagie1111 Help Archive 2 08/02/2010 01:26 PM
Date to Day calculation Help!! RyDeR` Everything and Nothing 2 25/12/2009 10:16 AM
Keep server running on Cent OS Stunterz Server Support 2 13/08/2009 03:37 PM


All times are GMT. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.