Difference between revisions of "To float"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
m
imported>Eliteofdelete
(Does not work for "anything". Only Booleans and ints.)
Line 15: Line 15:
 
}}|
 
}}|
  
function_description=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|to_int()]] is performed first, and then converted to a float.|
+
function_description=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 booleans, a transparent conversion as per [[to_int|to_int()]] is performed first, and then converted to a float. All other data types do not work.|
  
 
needscode=yes|
 
needscode=yes|

Revision as of 21:41, 21 January 2015

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 booleans, a transparent conversion as per to_int() is performed first, and then converted to a float. All other data types do not work.