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
Decimal Shift
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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###.###")
Last edited by ray.wurlod on Thu Aug 10, 2006 4:26 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
What about
Guessing if your data is 999999 then you want 999.999
Code: Select all
Value/1000
Success consists of getting up just one more time than you fall.