Formatting a numeric as a string - Issue?
Posted: Mon Apr 06, 2015 9:49 pm
If I'm following the "format" documentation about casting a numeric as a string
The result is not 5 but 5.000000 even if the variable tNum is defined as an Integer.
if we have this handler
The result is 5
If we are introducing a loop:
The result is:
1
2.000000
3.000000
Code: Select all
public handler myHandler()
variable tNum as Number
variable tNumString as String
put 5 into tNum
format tNum as string
put the result into tNumString
log tNumString
end handler
if we have this handler
Code: Select all
public handler myHandler()
variable tNum as Number
put 5 into tNum
log tNum
end handler
If we are introducing a loop:
Code: Select all
public handler myHandler()
variable tLine as Integer
repeat with tLine from 1 up to 3
log tLine
end repeat
end handler
1
2.000000
3.000000