Hi, We are trying to retrieve float values from database but the value retu

Hi,
We are trying to retrieve float values from database but the value returned is rounded to 1 decimal.
For eg: When the value in database is 100.54, queryrule and queryentity return value as 100.5 whereas executequery returns 100.54.
We modified the xsd to include the JPA annotation columnDefinition for an attribute which didnt change the output of the query rule. Please see attached document for further info and let me know if I am missing anything.
Thanks

Appian_RoundingIssue_Forum.docx

OriginalPostID-187452

OriginalPostID-187452

  Discussion posts and replies are publicly visible

Parents
  • Hi Nikhil,
    Which database are you using ?
    If its MySQL try updating the XSD as mentioned below :
    <xsd:element name="amount" nillable="true" type="xsd:decimal">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="Amount", columnDefinition="Decimal(10,2)")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    Configure the column data type as "Decimal" and length as (10,2) in database as well.
    This link provides the maximum precision in Appian :
    forum.appian.com/.../Custom_Data_Types_from_XSD.html
    Else you could use fixed function at the output of the query entity
    Example : fixed( todecimal(100.540), 2) output is - 100.54
Reply
  • Hi Nikhil,
    Which database are you using ?
    If its MySQL try updating the XSD as mentioned below :
    <xsd:element name="amount" nillable="true" type="xsd:decimal">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="Amount", columnDefinition="Decimal(10,2)")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    Configure the column data type as "Decimal" and length as (10,2) in database as well.
    This link provides the maximum precision in Appian :
    forum.appian.com/.../Custom_Data_Types_from_XSD.html
    Else you could use fixed function at the output of the query entity
    Example : fixed( todecimal(100.540), 2) output is - 100.54
Children
No Data