don't want to round a string to decimal
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru
don't want to round a string to decimal
Inputstring=5.9999999999999999999
expectoutoput(decimal,26,8)=5.99999999
but i am getting 6.00000000 (decimal,26,8)
how to acevied this ia m using stringtodecimal
Please help
expectoutoput(decimal,26,8)=5.99999999
but i am getting 6.00000000 (decimal,26,8)
how to acevied this ia m using stringtodecimal
Please help
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are four rtype arguments you can use with decimal processing; ceil, floor, round_inf and trunc_zero. The default is trunc_zero.
Read about them in Appendix B of the Parallel Job Developer's Guide for more information.
Read about them in Appendix B of the Parallel Job Developer's Guide for more information.
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.
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Hi,
I am not able to recollect the exact parameter name but i think it is:
APT_DECIMAL_INTER_ROUND_MODE... or
APT_DEC_INTERM_ROUND_MODE
You can check the variable :
APT_DECIMAL_INTER_ROUND_MODE=None.
I am not able to check the result since right now i do not have the acess to DS.
Hope this will help you out!
I am not able to recollect the exact parameter name but i think it is:
APT_DECIMAL_INTER_ROUND_MODE... or
APT_DEC_INTERM_ROUND_MODE
You can check the variable :
APT_DECIMAL_INTER_ROUND_MODE=None.
I am not able to check the result since right now i do not have the acess to DS.
Hope this will help you out!
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru
Hi there, Thanks for possible solutions,
Sol1:
I can applied APT_DECIMAL_INTERM_PRICISION TO NONE
-But the same results.
Sol2:
i know there are ceil,floor, round_inf and trunc_zero(default)
-But all there are meant to say how to round the input value.
But i don't want to round the input
input(varchar300)=5.99999999999
expected output(Decimal26,8)=5.99999999 but its rounding to 6.00000000
Sol1:
I can applied APT_DECIMAL_INTERM_PRICISION TO NONE
-But the same results.
Sol2:
i know there are ceil,floor, round_inf and trunc_zero(default)
-But all there are meant to say how to round the input value.
But i don't want to round the input
input(varchar300)=5.99999999999
expected output(Decimal26,8)=5.99999999 but its rounding to 6.00000000
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru
Thanks Ray,
'floor' option has solved one requirement i.e for not to round the values
but this will not cater for exponential values.
inputvalves=5.99999999999 and 9.9999999999999995e-07
using StringToDecimal(inputvalues,'floor') does not work for expo values
as a test job i am handling expo values as AsDouble(inputvalues)
Please advice to handle for both types in inputs.
Thanks in advance
'floor' option has solved one requirement i.e for not to round the values
but this will not cater for exponential values.
inputvalves=5.99999999999 and 9.9999999999999995e-07
using StringToDecimal(inputvalues,'floor') does not work for expo values
as a test job i am handling expo values as AsDouble(inputvalues)
Please advice to handle for both types in inputs.
Thanks in advance
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 104
- Joined: Sat Dec 24, 2005 1:26 am
- Location: Bengaluru