Monday, February 22, 2010

X++ real vs numeric(32,16)

It is an interesting fact that X++ real type is not fully compatible with the table field real type. The problem is that in the database numeric(32,16) data type is used to store fields of the real type. Numeric(32,16) data type stores numbers with no more than 32 digits total and no more than 16 digits after the decimal point, so value 1033 cannot be stored with this data type. X++ real type is floating-point type and can store values in the range from -10127 to 10127.
The following code execution will fail:
public static void testReal()
{
    InventTrans inventTrans;
    real realValue = 1.0e33;

    inventTrans.Qty = realValue;
    inventTrans.doInsert();
}
With the following exception:

3 comments:

  1. Thanks to give me solution for X++ real vs numeric.

    ReplyDelete
  2. I love your article so much. Good job
    Participants who complete the assignments and projects will get the eligibility to take the online exam. Thorough preparation is required by the participants to crack the exam. ExcelR's faculty will do the necessary handholding. Mock papers and practice tests will be provided to the eligible participants which help them to successfully clear the examination.

    Excelr Solutions

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete