Author Topic: Convert INT or SMALL to DEC  (Read 3129 times)

mikelimtw

  • Jr. Member
  • **
  • Posts: 51
Convert INT or SMALL to DEC
« on: March 12, 2017, 12:59:23 PM »
I've tried various ways to get an Integer variable converted to a Decimal one. The reason is that the Variable Pause command only works with decimal numbers.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: Convert INT or SMALL to DEC
« Reply #1 on: March 12, 2017, 02:02:15 PM »
Code: [Select]
Set integer [int] value to 100
Set decimal [dec] value to the converted value of {INT:int}
Write '[Purple] {INT:int} = {DEC:dec}' to log
Writes "100 = 100" to the log.

Use the "Convert Text/Token" field with the appropriate token for your source datatype. The "Another variable" field refers strictly to other decimal type values.

mikelimtw

  • Jr. Member
  • **
  • Posts: 51
Re: Convert INT or SMALL to DEC
« Reply #2 on: March 13, 2017, 03:18:50 AM »
I have a small integer that I was trying to convert... I placed {SMALL:intVariablename} in the convert token field but I kept getting error conversion failed message. After trying several variations, I gave up and posted this. I will try this again and let you know.

EDIT: Well I'll be a monkey's uncle. It works now. :P
          Thanks Pfeil
« Last Edit: March 13, 2017, 03:42:30 AM by mikelimtw »