[Bug] Label.Text only allows text constants, but any variable types (WAS: Can't directly display math constants)

Hi All,

(Edit: Some corrections later in thread. Thanks!)

Don’t seem to be able to directly display math constants (can’t coerce to text type?). The following won’t connect:

A workaround is to add intermediate variable, then to display the variable:

Results in:

1.618033988749895

Thanks!
BillG

Because Label1.Text expects a String value.

@pavi2410 That’s not true. Labels can display integers, and all types of text values.

If it can accept integers, but this constant is not integer, but a float or double (in java, or maybe in language used for iOS)

2 Likes

Hi All,

I tried some other experiments, and found that Label.Text only seems to like constant text values, but allows variables of any type. It doesn’t like constant numbers and constant lists (but those are allowed in Thunkable Android). IMHO, Label.Text should be able to coerce (almost) any type to its text type.

Thanks!
BillG

1 Like

Thanks for figuring this out for us. I’ll add it to the documentation!

2 Likes

Un compteur avec bouton + et - avec l’impossibilité de descendre en dessous de zéro avec un bouton de remise à zéro s’écrit donc comme ça?

Hi @albert, @thunkable,

Just a double-check: IMHO, I would consider this broken (a bug), not a documentation problem. The Label.Text block should be able to coerce any type to a text (string) type. Note that this works properly in Android Thunkable.

Thanks!
BillG

2 Likes

Got it – just added this to our queue as well.

Thanks!
Albert