Hi all,
I have a string "-65".
In the transformer I want to do a mathematical operation on this string.
So I need to convert this string into number. How do I handle negative sign. Will DS function StringToDecimal work?
How do I accomplish this ?javascript:emoticon(':roll:')
Rolling Eyes
Thank u
String to Number
Moderators: chulett, rschirm, roy
Even though DS will do an implicit conversion from string to number in a transform stage, it is much better to explicitly convert using a function such as StringToDecimal(), which will take care of the sign.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The overhead of invoking a JVM for every row is probably something you don't want. Prefer
If you're happy that you have a solution, please mark the thread as Resolved.
Code: Select all
Convert(" ", "", InLink.TheNumericString)
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: 33
- Joined: Sun Jun 24, 2007 9:46 pm
Convert() will not round, this is being done elsewhere. What is the defined datatype of the column or stage variable or derivation where you are doing thsi?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>