Raised This Month: $ Target: $400
 0% 

Value float or Integer?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2012 , 12:59   Re: Value float or Integer?
Reply With Quote #1

Quote:
Originally Posted by Larcyn View Post
Thanks for your replys, but these can't help me. I should provide more information I guess.

I'm trying to add it into a calculator I made, http://forums.alliedmods.net/showthread.php?t=172415

PHP Code:
format(szArgcharsmax(szArg), "%d"mathEvaluateEquation(szArg)) 
I want to check if the output of mathEvaluateEquation(szArg) is an integer value or if it's a float so I can print out the correct value when a player is dividing something which will contain decimals.
A function like that should always return a float and therefore you can always use something like "%.2f". You should post that entire mathEvaluateEquation() function if you want more accurate help.
__________________
fysiks is offline
Larcyn
Senior Member
Join Date: Oct 2010
Old 05-12-2012 , 16:16   Re: Value float or Integer?
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
A function like that should always return a float and therefore you can always use something like "%.2f". You should post that entire mathEvaluateEquation() function if you want more accurate help.
I am aware that I can use %.2f in this case, but it would be better if i just had plain numbers instead of decimals when it's an integer value.
__________________

Taking private requests, PM me for information.
Selling HideNSeek & Jailbreak plugins.

Selling Achievement API System (PHP &
MySQL / nVault)
Larcyn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-13-2012 , 02:20   Re: Value float or Integer?
Reply With Quote #3

Quote:
Originally Posted by Larcyn View Post
I am aware that I can use %.2f in this case, but it would be better if i just had plain numbers instead of decimals when it's an integer value.
Did you try Xalus' method?
__________________
fysiks 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 00:24.


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