(Solved)How to use a float in a label

Started by FanOfHumor, Wed 19/01/2022 16:00:58

Previous topic - Next topic

FanOfHumor

I need to put an integer into a label.text.I converted the integer to float but I cant seem to convert float to string.
Label4.Text=IntToFloat(player.x);
What is wrong with this?
In fact I cant seem to put anything other than string in labels. Yet I can put integers and others into player.say.

eri0o


Khris

Exactly, for instance like this:

Code: ags
  Label4.Text = String.Format("player x is %d", player.x);


Conversion to float is pointless here; you can insert an integer into a string as well.

FanOfHumor


SMF spam blocked by CleanTalk