Page 1 of 1

Decimal to String conversion in a rule

Posted: Thu Oct 14, 2010 1:33 pm
by lshort
I am creating a rule.

src_col1 = 124.000000
I want to change this to 124 (without the decimal or zeros).
c/p from docs:
tostring(value, format string)
Definition: Converts a value, such as number, time, or date, to its string representation.
%i
Represents the value to be converted into a signed decimal integer, such as "123."
According to the documentation the following line of code should do the trick:
tostring(src_col1,'%i')

It does not. The result is 0

Posted: Sat Nov 13, 2010 12:57 am
by akbar2002
:idea: Read it as Integer or Bigint. It will do the trick.

Let us know if it works.

Posted: Sat Nov 13, 2010 6:09 pm
by ray.wurlod
If this is a Rule Definition, can you specify the value as a global logical variable, as just 124?