Difference between revisions of "Truncate"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
(Created page with '{{ #vardefine:name|truncate}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function_category=Math and Numbers| function1={{Function| name={{#var:name}}| a…')
 
imported>Bale
m
 
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Math and Numbers|
 
  
 
function1={{Function|
 
function1={{Function|
Line 21: Line 20:
  
 
}}
 
}}
 +
 +
[[Category:Math and Numbers]]

Latest revision as of 05:07, 22 May 2010

needs(code_samples);

Function Syntax

int truncate(float number )

  • number is the number to truncate

Returns the truncated integer version of number (that is to say, everything after the decimal point is ignored completely, regardless of how close to or far from the integer portion the supplied number may be).