Raised This Month: $ Target: $400
 0% 

check if number is float


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-13-2014 , 12:12   Re: check if number is float
Reply With Quote #8

That's strange, I'm almost sure it existed o.O

Well, this is still better (by Exolent) than a contain check:

PHP Code:
stock bool:is_str_float(const string[])
{
    new 
cip;
    while(
is_char(string[i++]))
    {
        if(!
isdigit(c))
        {
            if(
!= '.' || p)
            {
                return 
false;
            }
            
            
1;
        }
    }
    
    return (
1);


Last edited by Backstabnoob; 08-13-2014 at 12:13.
Backstabnoob 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 13:14.


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