Is integer: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m moved Is numeric to Is integer: Function was renamed.
imported>Bale
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{
{{
#vardefine:name|is_numeric}}{{
#vardefine:name|is_integer}}{{
#vardefine:return_type|boolean}}{{
#vardefine:return_type|boolean}}{{


FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Math and Numbers|


function1={{Function|
function1={{Function|
Line 20: Line 19:
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().|
}}
}}
{{RFI|Shouldn't this function be named is_integer() or similar, rather than is_numeric(), if decimals return false?}}
 
[[Category:Math and Numbers]]

Latest revision as of 05:05, 22 May 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().