A :float on GUI

I am trying to display the :float variable on my GUI, but the debugging message keeps telling me, that it can not convert the float to string. Is there a way to display the :float variable on the GUI? There’s a lot of tutorials for the menu part of the GUI, but I can’t find one for the interface itself…

Every type in CIL has a ToString function. What it does depends on the type. Some just return the classname, but most valuetypes return their value as string. You can even specify a format string for int or float values.

var myValue : float;

myValue.ToString("000.0");  //3 leading zeros and one fractional-digit

The compiler also tries to convert floats or ints automatically if it’s used in a string concat like this:

var myString = "" + myValue;

this is the same as

var myString = myValue.ToString();