Raised This Month: $ Target: $400
 0% 

Float question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 12-04-2016 , 12:07   Re: Float question
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
This goes for all languages including pawn, therefore I posted it in this section.

Example:

PHP Code:
new Float:value[33];

public 
plugin_init()
// ...

public showValue(id)
{
        
client_print(idprint_chat"Your value: %f"value[id]);
}

// ... blah some other code that include changing the var 
This will print out "Your value: 0.0000000" (I don't know the exact number of zeros), now, I want to force it to print the floating value as n.n, like: 0.0 or 10.0 or 12.5 or 200.3, exactly like that... how do I manage to do that, is it possible?
Like This:
%.1f // One Number After Dot
%.2f // Two Number After Dot, Etc...
Beqa Gurgenidze is offline
 



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 01:17.


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