Validation

Hi ,

I have one scenario that where 

if the value is not 0 and the values should not round off and it should accept up to 9 decimals like 3.612232423.

 

Minimum Rate: 3.5

Maximum Rate: 4

 

input value is of number(dec) format i mean CDT has this data type, how can we achieve this if user enters any values apart from the scenario mentioned above should not except.

 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Appian Employee
    in reply to sid

    Is this what you're trying to do? This will validate that that the value must be between 3.5 and 4 and that it can have a maximum of 9 digits after the decimal point:

    a!localVariables(
      local!decimalValue: todecimal(null),
      a!floatingPointField(
        value: local!decimalValue,
        saveInto: local!decimalValue,
        validations: {
          if(
            or(
              local!decimalValue > 4,
              local!decimalValue < 3.5
            ),
            "Value must be between 3.5 and 4",
            null
          ),
          if(
            round(local!decimalValue, 9) <> local!decimalValue,
            "Value must have 9 or fewer digits after the decimal point",
            null
          )
        }
      )
    )

Children