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
Thank you and agam for your quick replies but the value itself is getting changed. While querying it via query entity from database only, we are not getting the entire value. We are already converting that decimal value into text before displaying it on screen
Hi dikshag
Can you show your interface code how you are showing the value ?
Also, did you use the function "fixed" ?
How are you converting the value to text
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.
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?
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.
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.