<RetVar> = The name for the new variable containing the string.
<Var/Number> = The variable / Integer that you wish to convert to a string.
Converts the input integer <Var/Number> to a string, including the separators (1000 -> 1,000).
- Luckily this is localized, thus using it in different languages will always use the right separator for your language.
Note:
- It is important to be sure you only try to convert an integer to a string. Attempting to convert other Data Types will result in the game locking up.
Examples:
$this.number = 123456
if is datatyp[ $this.number ] == DATATYP_INT
| $new.string = convert number $this.number to string
else
| $new.string = $this.number
end
In the above example, the variable $this.number is checked to see if it is an integer before converting it to a string. If it fails the integer check the original value for $this.number is used by $new.string. This can become problematic, so an alternative method is shown below.
--------------------------------------------
$this.number = 123456
if is datatyp[ $this.number ] == DATATYP_INT
| $new.string = convert number $this.number to string
else
| $new.string = sprintf: fmt = %s, $this.number, null, null, null, null
end
Command Location:
- »» General Commands
- »» Strings
<RetVar> = convert number <Var/Number> to string
- »» Strings