Hello Everyone,
I've tried to find it here but without luck, so here is my question,
i want to "trunc" a decimal number up to the 3rd position after the decimal separator, i don't want to round the number.
for example:
i have a decimal number --> 1785.65897
and i want the result to be --> 1785.658
what is the simplest why to accomplish it in Datastage?
thanks,
Datamine
trunc a decimal number to the X position
Moderators: chulett, rschirm, roy
Re: trunc a decimal number to the X position
Two ways :
Change the precision of the decimal to n,3
Treat as a string , do a substring from 1 to index of 1st occurence of '.' + 3.
Change the precision of the decimal to n,3
Treat as a string , do a substring from 1 to index of 1st occurence of '.' + 3.
Regards,
Ganesh
Ganesh
I prefer "INT(In.NumberColumn/1000)*1000" to get 3 decimal positions.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: