Page 1 of 1

How to Achieve integer value with out exponential value

Posted: Mon Feb 13, 2006 1:28 pm
by somu_june
Hi,

Can any one help me. I have a stage variable totalpriceval. In properties of stagevariable I mentioned precision as varchar 255 . Iam getting frm source flat file price as char[15] to stage variable . Ex

variable expression
totalprcval If frm_src.recindicator='2' then totalprcval+As integer (frm_src.price) else totalprcval.

I gave in stage variable proprerties
name initalvalue

totalprcval 0 varchar 255

In output Iam getting as 2.72922e+11. I want output as 272922234556 as integer with out exponential . What I have to do to achieve integer value.

Thanks,
Somaraju

Posted: Mon Feb 13, 2006 1:37 pm
by tardifma
Why don't you use a real integer variable? You could convert your string input field to an integer by using the StringToDecimal function.

Mathieu

Posted: Mon Feb 13, 2006 1:43 pm
by somu_june
Hi Mathieu,

Please correct me if I understood your reply wrong. I have to give in stage variable properties totalprcval precision as int 64 and in expression of stage variable in place of As integer I have to give string to decimal function.




Thanks,
Somaraju

Posted: Mon Feb 13, 2006 1:49 pm
by tardifma
Hi,
What I am saying is if you input is something like '27292223455' (Varchar(15)), then you could define your variables as BigInt and convert it to a number by using the DecimalToString function...

Is this what you try to do? or if your input have the 2.72922e+11 format as well?

Mathieu

Posted: Mon Feb 13, 2006 2:17 pm
by somu_june
Hi Mathieu,


I gave in stage properties stage variable totprcval sql type as bigint . I got my output with out any exponentional value . Thanks for solving my problem.





Thanks,
Somaraju