cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert Integer to String Function

former_member184594
Active Contributor
0 Likes
15,108

I am trying to convert integer to string, but there is no such function. Or at least, I couldn't find one. There is conversion from float to string functions. However, there is no int to string.

Do you know how?

I found a workaround, but I am not sure if this is the right approach.

var int_tst = Convert.stringLength(string_tst);

var float_tst = int_tst + 0.0;

TEXT_2.setText(Convert.floatToString(float_tst,"#0"));

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi

Its quite easy.

all you have to do is add "" to your number :

var int_tst = 3;

TEXT_2.setText(int_tst+ "");


it will do the work


good luck

Roman

former_member184594
Active Contributor
0 Likes

Thanks. This is much better than what I did.

Former Member
0 Likes

Hi Roman,

I am also tried to convert int to string in my application and faced the same difficulties like Zahid. Your reply helped me to perform int to string conversation. Thanks a lot :-).

Regards

Saranya

Former Member
0 Likes

Thanks Roman. This solution is awesome.

Martin_4
Participant
0 Likes
Use the ConvertUtils: var MyInteger= ConvertUtils.stringToInteger("123");

Answers (1)

Answers (1)

Former Member
0 Likes

In standard JavaScript, you'd just do int_tst.toString(). Does this function not work in Design Studio?

former_member184594
Active Contributor
0 Likes

Nope that doesn't work. It is interesting Design Studio doesn't have convert from int to string.