Starting native.newTextField

I would like to know how to start a native.TextField with a value already set in it, being this value of type float / decimal.

After you create the field, add this line

mytextfield.text=“mydefaulttext”

thats it :slight_smile:

If you are talking about editing the field, you need to handle it in the listener.

This way it worked, thank you

And as it is done to insert a number of the decimal type, for example 15.52, in the Field Field?

Its the same method. Once you have the number as a string, you can later when you need convert it to a number using

mynumber=tonumber(mytextfield.text)

You will find this all in the documentation from Corona, which is well made,

Best of luck!  :slight_smile:

After you create the field, add this line

mytextfield.text=“mydefaulttext”

thats it :slight_smile:

If you are talking about editing the field, you need to handle it in the listener.

This way it worked, thank you

And as it is done to insert a number of the decimal type, for example 15.52, in the Field Field?

Its the same method. Once you have the number as a string, you can later when you need convert it to a number using

mynumber=tonumber(mytextfield.text)

You will find this all in the documentation from Corona, which is well made,

Best of luck!  :slight_smile: