IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Using FRONUMBER function

    Posted 04/22/07 02:02 PM

    Originally posted by: vickey


    Hi,

    I need help in using the function FROMNUMBER. As, you all know specific need of FROMNUMBER is to convert the text into the number format we need.

    I have a scenario where the input is a number like 2.6 or 2.60 or 15.2 or 15.24

    The output item field is 7 character length

    For 2.6 or 2.60

    I need to get the output as : 0260000

    for 15.2 or 15.24
    I need to get the output as : 1520000 or 1524000

    Need any ones inputs to use the FROMNUMBER second argument option.

    i.e syntax of FROMNUMBER(Texttoconvert,FORMAT). I am not able to give the format to meet my requirements.

    Thanks for the help.

    -Vikash.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Using FRONUMBER function

    Posted 04/22/07 02:29 PM

    Originally posted by: SystemAdmin


    Can you just multiply your input number by 10,000? And then pad with zeros:

    =FILLLEFT(NUMBERTOTEXT(<input number> * 10000),"0")

    Olly.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Using FRONUMBER function

    Posted 04/22/07 11:35 PM

    Originally posted by: vickey


    Thanks Olly.

    We can also do the same using either of the below logics.

    1) FILLLEFT(WORD(FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input),".",1),"0",2)
    + FILLRIGHT(WORD(FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input),".",2),"0",5)

    or

    2) FILLLEFT(MID(FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input),1,
    FIND(".",FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input))-1),"0",2)
    + FILLRIGHT(MID(FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input),
    FIND(".",FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input))+1, SIZE(FROMNUMBER(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input))),"0",5)

    and the last is yours which is simple than the above two
    3) FILLLEFT(NUMBERTOTEXT(Value:ElemDecl UnitPrice:Seq:ElemDecl LineItem:Seq:ElemDecl PurchaseOrder Element:Global:Input* 100000),"0",7)

    But I want to do this using only FROMNUMBER functions, by using the second optional argument.

    once agaian thanks for the reply.

    -Vikash
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Using FRONUMBER function

    Posted 04/23/07 04:56 AM

    Originally posted by: SystemAdmin


    in theory something like:
    FILLLEFT (FROMNUMBER (15.24, "{L-####'V'5}"),"0",7)
    should work, but there are bugs in the format string handling that mean the implicit decimal place goes in the wrong place (TX is ignoring where the decimal point is in the input string)

    So I'd stick with the simpler option of multiplying your input by 10,000

    Olly.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 5.  Re: Using FRONUMBER function

    Posted 04/23/07 06:44 AM

    Originally posted by: janhess


    Olly,
    Has this been raised as a bug with IBM?
    Jan
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 6.  Re: Using FRONUMBER function

    Posted 04/23/07 07:48 AM

    Originally posted by: SystemAdmin


    I've not raised it as a bug (we've got no requirements for implicit decimals), it does look like a bug though.
    Olly.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Using FRONUMBER function

    Posted 04/27/07 09:37 AM

    Originally posted by: vickey


    Thanks for the help Olly. Sorry for the delayed reply. I was out of office for the past few days.

    Even I tried having your logic, it seems like a bug as you told. I am finding to have more scenarios so that we can report to IBM as BUG.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 8.  Re: Using FRONUMBER function

    Posted 08/13/07 01:44 AM

    Originally posted by: SystemAdmin


    =RIGHT("0000000" + NUMBERTOTEXT(2.6 * 100000),7)
    This is the simplest I think.
    Replace 2.6 with whatever you want.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 9.  Re: Using FRONUMBER function

    Posted 08/01/07 05:34 AM
      |   view attached

    Originally posted by: SystemAdmin


    you don't need to use the function FROMNUMBER if you only want to convert a input number item to a output number in a different format.
    Let's TX reformat the input format to the new one with using type tree input / output proporties.

    in the attached file, i made a map who convert a number like 2.6 or 2.60 or 15.2 or 15.24 format to a number with your wanted format
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)