Do we have any data type to hold number exceeding 10 digits?...

Do we have any data type to hold number exceeding 10 digits?...

OriginalPostID-116363

OriginalPostID-116363

  Discussion posts and replies are publicly visible

  • Couple of options available
    1. You can use number decimal data type. In this case, the value will be stored as an exponential
    2. Another option is to use text data type if you keep the number as text
  • In our case, we have CDT which accepts Number data type (It can be integer/decimal) - so we have used floating point field which will allow decimals along with integer. Now when we add more than 7 digits, the value rounds off. While using integer fields which comes with a validation of total max length 2,147,483,647 ,it is converted to exponential.

    We can't use text as Number is defined data type of CDT, and also we want to allow decimals, is there any way we can achieve this using floating point field?

    Example:
    Value used is 123456789
    After entering, it's automatically rounded up to be 123456800
    In Tempo, it shows 1.234568e 08
  • 0
    Appian Employee
    in reply to tapans

    It might help if you use fixed(). In some cases, the number is stored with greater precision than is displayed by default. fixed() may allow you to display the number with greater precision.

    For example, tostring(1234.5678) will return the string "1234.567", but tostring(fixed(1234.5678,4)) will return "1,234.5678".

    If I remember correctly, this can help for numbers up to 16 digits. Beyond that, you may need to take a different approach, such as storing the values as strings.

  • Hello Eliot,

    Thank you for your response. Actually we have to use a single field which will serve the purpose for integer and decimal, reason being we have single data type 'Number' which is defined. Now in certain case let say entering KeyDevIds, we require entering 9+ digits integer and in a case where we are measuring time, we need to enter value in minutes and seconds which requires decimal, Hence we are using floatingpoint field which will allow integer values too. The issue with floatingpoint is, value automatically converts to exponential if the length of digit is more than 7.

    So wondering if there is anything with floatingpoint field I can do which will serve my purpose.
  • afaik we can not convert decimal data to string as you want also not in integer as this exceed the integer limit.
  • Hi Nimisha, Hope this will resolve your problem
    Create a CDT with a field "amount" of type Number(decimal),
    load(
    local!value,
    a!sectionLayout(
    label:"Test the Number",
    firstColumnContents:{
    a!floatingPointField(
    label:"Enter any number",
    value:ri!CDT.amount,
    saveInto:{
    local!value,
    a!save(ri!CDT.amount,fixed(local!value))
    }
    ),
    a!textField(
    label:"entered Value",
    value:fixed(ri!CDT.amount)
    )
    }
    )
    )
    You need to use the fixed function to show it from exponential to number.