Decimal to String
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I agree. Being anal, the function only 'keeps' the delimiter if you tell it to return multiple delimited substrings and then only between the instances. So 'using' would have been more accurate. And to continue the theme:
We've seen plenty of examples here where people think something is working as they'd like when in fact they are taking advantage of a bug... and then a future update closes the loophole and things 'mysteriously' break. So I would suggest rather than posting something like that, take the time to use the function properly inside the Field function. That would make it 'future proof'.
That wasn't what was being discussed, especially since you specified a period as the delimiter. It was the question 'does the function work with a decimal' and the answer is still officially 'no' according to the documentation. And for all we know that only 'works' in your specific version, something thing we've seen before.ssnegi wrote:So the field operator does use the . as delimiter for extracting from a decimal.
We've seen plenty of examples here where people think something is working as they'd like when in fact they are taking advantage of a bug... and then a future update closes the loophole and things 'mysteriously' break. So I would suggest rather than posting something like that, take the time to use the function properly inside the Field function. That would make it 'future proof'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Actually, in this specific case, there is probably an implicit conversion performed from decimal to string, since the Field() function requires a string data type as its first argument.
I prefer not to rely upon implicit conversions in parallel jobs.
I prefer not to rely upon implicit conversions in parallel jobs.
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.
Code: Select all
DecimalToString(Field(DecimalToString(DSLink.COL),'.',1),"suppress_zero"):'.':Field(DecimalToString(DSLink.COL),'.',2)