Truncate

From Kolmafia
Revision as of 22:26, 10 March 2010 by 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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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).