Struggling with Str() vs .ToText / .ToString

Number to String conversion with Str(Number) is obvious, when it was still functioning.
Now it has to be done by Number.ToText or Number.ToString.
Until now I have not found a one line solution for this: label.Text = Str(1 + 1).
I can’t use (1 + 1).ToText.
So I use an extra line to temporarily store the result, like Var tmp As Integer = 1 + 1.
And on a second line: label.Text = tmp.ToText

But I have a strong feeling I am overlooking something.
Anybody who can write this in one line of code?

Integer(1+1).ToText()

There’s probably a more elegant way someone will chime in with.

1 Like

It’s elegant enough for me… :slight_smile:
Thank you.

1 Like

Note that the “Text” datype is deprecated, you’r better off using string.

Deprecated:
http://documentation.xojo.com/api/deprecated/text.html

Alternative (API 2.0):
http://documentation.xojo.com/api/data_types/string.html