Difference between revisions of "Is integer"

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m (Removed RFI because the function had been renamed.)
imported>Heeheehee
m (Added a note regarding the renaming of this function.)
Line 20: Line 20:
 
needscode=yes|
 
needscode=yes|
  
special=This function does not return true for valid decimal numbers (the decimal point character causes a return value of false).|
+
special=This function does not return true for valid decimal numbers (the decimal point character causes a return value of false).
 +
</p><p>
 +
Prior to revision 8314, this function was is_numeric().|
 
}}
 
}}

Revision as of 04:24, 25 March 2010

needs(code_samples);

Function Syntax

boolean is_integer(string check )

  • check is the string to check

Returns true if a string consists of only digits and comma-separators, with a negative sign allowed as the first character. Note that all commas are ignored by this function (they don't have to follow the normal separation rules of once every three digits, and can even occur multiple times in a row; however, they cannot be the first character or this function will return false).

Special

This function does not return true for valid decimal numbers (the decimal point character causes a return value of false).

Prior to revision 8314, this function was is_numeric().