string

Turns a real number into a string.

Syntax:

string(realNum);


Argument Description
realNum The real number to be turned into a string.


Returns: String


Description

With this function you can turn any real number into a string. If the real number is an integer, it will be saved with no decimal places, otherwise, it will be saved with two decimal places.


Example:

draw_text(100, 100, "Score: " + string(score) + " / Health: " + string(health));

The above code uses the string function to draw both real numbers and strings together (draw will only accept either a string or a real, but not both).


Back: Strings
Next: string_byte_at
© Copyright YoYo Games Ltd. 2018 All Rights Reserved