Hi All #RoundingOff #FloatToDecimal #XSD 1) We have a CDT wherein one of it

Hi All #RoundingOff #FloatToDecimal #XSD
1) We have a CDT wherein one of its field was defined with 'float' property (mapped to the table with the type of float as well in the database).
This is how that field in the XSD looked like.
           <xsd:element name="FundAmt" nillable="true" type="xsd:float">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Column(name="fund_amt", columnDefinition="FLOAT")</xsd:appinfo>
</xsd:annotation>
</xsd:element>
          
Now in the process, the above CDT field holds the value = 6244676.65. When this is passed to 'Write to Data Store' node (in order to insert the value to the table in the database) - Appian is converting is to 6244676.50 automatically which is bit strange as there is NO explicit rounding done in either Appian process or Database end.

2) Now if I go to the database and manually update this figure in the table from 6244676.50 to the correct one ie, 6244676.65 and ...

OriginalPostID-203985

OriginalPostID-203985

  Discussion posts and replies are publicly visible

Parents
  • ...then hit a query rule/query entity on Appian, it still shows the incorrect one, ie, 6244676.50 (when tested directly on the interface).

    The above behavior is something which is not getting occured for all the figures but are some random values(not able to figure that out if there is some specified range for this to happen). For most of the figures, it does gets entered and displayed correctly.

    As a workaround, we modified the above CDT field annotation to change the field type from 'float' to 'decimal', keeping the columnDefinition (table column type) still same to 'float', thereafter which everything works fine. (see below the updated definition)
               <xsd:element name="FundAmt" nillable="true" type="xsd:decimal">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="fund_amt", columnDefinition="FLOAT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    Not sure, why Appian treats data type of 'float' differently from 'decim...
Reply
  • ...then hit a query rule/query entity on Appian, it still shows the incorrect one, ie, 6244676.50 (when tested directly on the interface).

    The above behavior is something which is not getting occured for all the figures but are some random values(not able to figure that out if there is some specified range for this to happen). For most of the figures, it does gets entered and displayed correctly.

    As a workaround, we modified the above CDT field annotation to change the field type from 'float' to 'decimal', keeping the columnDefinition (table column type) still same to 'float', thereafter which everything works fine. (see below the updated definition)
               <xsd:element name="FundAmt" nillable="true" type="xsd:decimal">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="fund_amt", columnDefinition="FLOAT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    Not sure, why Appian treats data type of 'float' differently from 'decim...
Children
No Data