Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
btpoole
Channel Surfer

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 2
destruk
Binge Watcher

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
Channel Surfer

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