Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
btpoole
Level 7

RETAIN 00 AFTER DECIMAL

I am trying to join a set of numbers that is where one is a integer and the other comes from a string. I am not sure of how to get it to work. I have the integer for example 12, I wish to join 00 directly after the 2. As you might guess I get type mismatch. I have tried couple of ways but either the 00 are not added or I get type mismatch. My latest effort shown here:

number=12
whole= str(1.00)
whole=mid(whole,3,2)
total= number + whole
Hoping total would be 1200
Any help or advice appreciated

Thanks
0 Kudos
2 Replies
destruk
Level 10

Re: RETAIN 00 AFTER DECIMAL

If your number is 12, and it is an integer, and you are trying to print it as a string, why not convert it to a string and then do a simple string operation on it before display?
ie

number=12
total=number.tostr()+"00"
' or ".00" to show two decimal places
Print total
0 Kudos
btpoole
Level 7

Re: RETAIN 00 AFTER DECIMAL

Thanks that was the operation I was looking for. I think I was trying to make the 00 into an integer.
0 Kudos