Page 1 of 1

Decimal Shift

Posted: Thu Aug 10, 2006 4:07 am
by Diya
Hi,

Im trying to apply a decimal shift to the incoming data.

Incoming column is Precision=6
Scale=0

Output format needed is
Precision=6
Scale=3.

That means I want to shift the incoming number 3 places to the right.

Is there an inbuilt function/routine for this?

Or can anyone tell me how to do that?

Thanks,
Diya

Posted: Thu Aug 10, 2006 4:24 am
by ray.wurlod
Several possibilities. For example:

Code: Select all

InLink.TheColumn / 1000

Code: Select all

Fmt(InLink.TheColumn, "6R3")

Code: Select all

Oconv(InLink.TheColumn, "MD3")

Code: Select all

Left(InLink.TheColumn, Len(InLink.TheColumn)-3) : "." : Right(InLink.TheColumn, 3)

Code: Select all

Fmt(InLink.TheColumn, "R###.###")

Posted: Thu Aug 10, 2006 4:26 am
by loveojha2
What about

Code: Select all

Value/1000
Guessing if your data is 999999 then you want 999.999

Posted: Thu Aug 10, 2006 4:38 am
by Diya
Thanks guys....I cudn even think of such a simple logic.. :cry: