Decimal Precision

Hi Guys,

I have several decimal fields in one database with a precision of 15 and a scale of 3 (DECIMAL (15,3)).

On my interface if I put a decimal with more than 12 precision digits the node Write to Data Store Entity is always failing. I already tested using a floatingpointfield and also a textfield (where I converted the text do decimal only to persisting purposes) to understand why this is happening.

Do you have any ideas how to overcome this? Because I need to consider decimal numbers up to 15 precision digits .

Best Regards,

FN

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You could possibly use the fixed function to get exactly 12 decimal places after a number, but the output will be a Text, and your XSD will have to cast the text directly into the DECIMAL type without going through Appian types.  15 significant digits is about the absolute limit of the Decimal type Appian uses, but also for reasons they always convert especially precise figures into scientific notation.  You have to use the fixed() function to get rid of the scientific notation.

    If that doesn't work, you'll need to build a custom Math plugin in Java or see if one is available from the AppMarket.  The Java will have to write to your DB if fixed() doesn't cut it.

Reply
  • 0
    Certified Lead Developer

    You could possibly use the fixed function to get exactly 12 decimal places after a number, but the output will be a Text, and your XSD will have to cast the text directly into the DECIMAL type without going through Appian types.  15 significant digits is about the absolute limit of the Decimal type Appian uses, but also for reasons they always convert especially precise figures into scientific notation.  You have to use the fixed() function to get rid of the scientific notation.

    If that doesn't work, you'll need to build a custom Math plugin in Java or see if one is available from the AppMarket.  The Java will have to write to your DB if fixed() doesn't cut it.

Children