Author |
Message
|
nick009 |
Posted: Wed Mar 08, 2017 10:18 am Post subject: Extract Decimal Part in Unit _WTX |
|
|
Newbie
Joined: 08 Mar 2017 Posts: 6
|
Team,
As part of my mapping I have a requirement to select the integer part and fractional part from the same input value. For the INT part I got the function, I could not find how to address the fractional part issue.
Input - Unit field : 123.05
Output - Unit-I : 123
Unit-F : 05
Unit -I is taken care of with the INT () function. Just need to handle the fractional part. Please drop your ideas.
Regards,
Nick |
|
Back to top |
|
 |
timber |
Posted: Wed Mar 08, 2017 10:30 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 08, 2017 10:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Isn't the fractional part what's left after you subtract the results of the INT() from the original number?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 08, 2017 10:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And there's that of course  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nick009 |
Posted: Wed Mar 08, 2017 10:40 am Post subject: |
|
|
Newbie
Joined: 08 Mar 2017 Posts: 6
|
That's Right Vitor.
When you use INT () function, it drops the fractional part and passes only the integer value.
EX : INT(234.0 will pass only 234 value.
In WTX, I am not 100% sure if I can save the input value just like we can do in MB and then use the logic to extract the required.
NICK |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 08, 2017 11:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nick009 wrote: |
In WTX, I am not 100% sure if I can save the input value just like we can do in MB and then use the logic to extract the required. |
You can certainly refer back to the original value.
And behold another good reason to use MB not WTX. Seriously. WTX is the preserve of complex, multi-level validation and transformations at the bit level. If all you're doing is converting XML to a copybook, then not only are you making it much harder for yourself but you're wasting the money that you're spending on WTX license (both for the design studio and the runtime). We have WTX on this site, so I speak with authority on cost.
If your immediate response is, "well we have other transformations that require WTX" then my retort is you don't need to use WTX for every single transaction given MB's routing capability.
Or to put it another way - if you really, believe you need WTX for all transformations, run it in standalone mode and cut MB out of the equation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|