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…')
(No difference)

Revision as of 22:26, 10 March 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).