To float: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
Created page with '{{ #vardefine:name|to_float}}{{ #vardefine:return_type|float}}{{ FunctionPage| name={{#var:name}}| function_category=Datatype Conversions| function1={{Function| name={{#var:nam…'
 
imported>Bale
mNo edit summary
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Datatype Conversions|


function1={{Function|
function1={{Function|
Line 21: Line 20:


}}
}}
[[Category:Datatype Conversions]]

Revision as of 05:21, 22 May 2010

needs(code_samples);

Function Syntax

float to_float( any anything)

  • anything is any data type that KoLmafia uses

This function looks for the best float match to the specified input, which varies by datatype. For int types, this function merely tacks ".0" to the end. For all others, a transparent conversion as per to_int() is performed first, and then converted to a float.