Retrieve decimal value having more than 7 digits after decimal places (from third party database)

Hi All,

In third party database, we have a column (number datatype containing decimal values - NUMBER(15,12)) which can have more than 7 digits after decimal place. In database, for example, the value is 33.3333333333

but when we are fetching the data via query entity, it is coming as 33.33333 and not the entire value. Datatype we have used in CDT is Number (Decimal) and xsd type xsd:decimal. We have also tried xsd:double in CDT but the result is same.

Is there any range restriction on Number(Decimal) ?

How to fetch the entire value from database?

Kindly advice.


Thanks and Regards,

Diksha

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    A Score Level 1
    in reply to agam

    No, we haven't used the function fixed. We type cast it to text with CDT. But the concern here is not while converting from decimal to text. It is working fine. The concern is while fetching the data from database itself, we are not getting the entire value.

  • 0
    Certified Lead Developer
    in reply to dikshag

    Well, keep the type as decimal in your CDT.

    And, even if your query entity doesn't reflect full value in its result, it should be fine.

    And use fixed function when you display it in your interface.

    Can you also describe your use case ?

    How is the external database connected with Appian, what database is it ?

    What do you want to do with the decimal digits?

    Is it just for proper display or you need to perform some calculations on top of it?

  • 0
    A Score Level 1
    in reply to agam

    Thanks for your suggestion, will try it once. External database is connected via data source with Appian.

    Regarding our use case, We are displaying those values in a grid and user can also change the value from screen. There's no calculations required on screen.

  • 0
    Certified Lead Developer
    in reply to dikshag

    This is your trouble right here.  You CAST it as text to the CDT.  That causes Appian to do all the implicit conversions it thinks it's supposed to do.  In general, Appian only displays 7 digits, and it assumes that's what you want because you haven't told it to do different.

    use fixed(whatever it is, 15) to output up to 15 digits of the decimal.  The output of the fixed function is a text that can go into your CDT.  You'll have to build the logic as part of a type constructor to take data from query and successfully map it to the CDT.