Global Sterling Data Exchange

 View Only
  • 1.  Integral part getting removed 0.14 is coming as .14 in output

    Posted 5 days ago

    Hi,

    Integral part of the decimal value is being removed; for example, 0.14 is displayed as .14. This happens only when integral part is 0. However, the requirement is that the output should exactly match the input, preserving the format as provided. Is there a way to ensure the output retains the same format as the input in IBM Transformation Extender?

    Thank You,

    Kavitha Rout



    ------------------------------
    Kavitha Rout
    ------------------------------


  • 2.  RE: Integral part getting removed 0.14 is coming as .14 in output

    Posted 3 days ago

    What is your number definition in the type tree?  Are all numbers coming in going to match this presentation?  If you have variable number presentation that has to be maintained you will need to make it a text item rather than a number to keep the format the same any way it comes in (example 12 or 0.14, or 1.0).  However, if it is always a decimal with 2 places (like a money presentation) you can do something like this:

    Happy mapping!



    ------------------------------
    Lisa Edwards
    Software Engineer / Subject Matter Expert
    Rainbow Data Systems, Inc
    ------------------------------



  • 3.  RE: Integral part getting removed 0.14 is coming as .14 in output

    Posted 3 days ago

    Hi,

    Its XSD and not type tree, with decimal .

    <xsd:simpleType name="ImpliedCurrencyAndAmount">
            <xsd:annotation>
                <xsd:documentation> The decimal separator is a dot. Note: a zero
    amount is considered a positive amount.</xsd:documentation>
            </xsd:annotation>
            <xsd:restriction base="xsd:decimal">
                <xsd:minInclusive value="0"></xsd:minInclusive>
                <xsd:totalDigits value="18"></xsd:totalDigits>
                <xsd:fractionDigits value="5"></xsd:fractionDigits>
            </xsd:restriction>
        </xsd:simpleType>

    Thank You,

    Kavitha Rout



    ------------------------------
    Kavitha Rout
    ------------------------------



  • 4.  RE: Integral part getting removed 0.14 is coming as .14 in output

    Posted 3 days ago
    1. Are you using the native XSD as your input type definition or the output definition or both?
    2. The original question still stands - can the format be variable? Is 12, 0.14, 1.0, 2.01234 all valid numbers that can come through this field (from definition it looks like it)? 
    3. Can you change the XSD?  Or import it to create a type tree and tweak it? What are your rules of engagement?

    Without knowing more or ability to tweak tree, you might try something like this: 
    =TONUMBER(ImpliedCurrencyAndAmount:XML, "[###########]#.##[###]")

    You can adjust the brackets for however many digits are significant before or after the decimal. 

    Let me know if this helps,



    ------------------------------
    Lisa Edwards
    Software Engineer / Subject Matter Expert
    Rainbow Data Systems, Inc
    ------------------------------