Advertisement
DraKiNs

[COD] IsFloat(string)

Aug 10th, 2011
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.44 KB | None | 0 0
  1. // Is Float check in String
  2.  
  3. IsFloat(string[])
  4. {
  5.     if(string[0] == '.' || string[strlen(string) - 1] == '.') return 0;
  6.  
  7.     for(new i, j = strlen(string), bool:b; i != j; ++i) {
  8.         if((string[i] > '9' || string[i] < '0') && string[i] != '.') return 0;
  9.         if(string[i] == '.') {
  10.             if(b) return false;
  11.             b=true;
  12.         }
  13.     }
  14.     return 1;
  15. }
  16.  
  17. // Criado por Bruno da Silva
  18. // www.ips-team.blogspot.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement