View this page in the latest version of Appian. Decimal Data Types in Appian Share Share via LinkedIn Reddit Email Copy Link Print On This Page Appian provides two data types for storing numbers with a fractional component: Number (Decimal Precise) and Number (Decimal Floating). This page describes each type, when to use each one, how database fields map to them, and where you can use them. Decimal data type options Appian supports two decimal data types: Number (Decimal Precise): Stores values using a big rational representation, which preserves exact precision. Number (Decimal Floating): Uses double-precision floating-point representation, which is efficient but can round values. The difference shows up in calculations where precision matters. The expression 0.1 + 0.2 evaluates to 0.30000000000000004 with Number (Decimal Floating), because floating-point representation cannot store these values exactly. With Number (Decimal Precise), the same expression evaluates to 0.3. Note: As of Appian 26.10, Number (Decimal Floating) is the name for the data type that was previously called Number (Decimal). This is a rename, not a new data type. Existing fields, values, and expressions that used Number (Decimal) continue to work without any conversion. When to use each decimal type The following table compares the two decimal types to help you choose: Characteristic Number (Decimal Precise) Number (Decimal Floating) How values are stored Big rational representation that preserves exact precision. Double-precision floating point, which is efficient but can round values. Best for Financial and currency calculations, exact results, values beyond the Number (Integer) range, and mapping database DECIMAL, NUMERIC, and NUMBER columns. Matching an existing application that already uses floating-point decimals, or calculations where an approximate result is acceptable. Default for decimal literals in expressions Yes. A decimal you type in an expression is a Number (Decimal Precise) value by default. No. Floating-point literals display with an f# prefix. Recommendation Recommended for new applications. Use for consistency with existing floating-point values. When an operation combines a Number (Decimal Precise) value with a Number (Decimal Floating) value, the result is Number (Decimal Floating). Match the type that the rest of your applications uses to keep calculations consistent. Map database fields to a decimal type When you create a record type, Appian maps each source field to an Appian field type. For database-backed record types, numeric source columns map to a decimal type based on the source type: DECIMAL, NUMERIC, NUMBER: Map to Number (Decimal Precise) by default. When these types have a scale of 0, they map to Number (Integer) instead. DOUBLE, FLOAT, REAL: Map to Number (Decimal Floating). You cannot map these source field types to Number (Decimal Precise). Precision and scale for Number (Decimal Precise) fields Number (Decimal Precise) fields are defined by two properties: Precision: The total number of digits. For example, 12345.67 has a precision of 7. Scale: The number of digits to the right of the decimal point. For example, 12345.67 has a scale of 2. Number (Decimal Precise) supports a maximum precision and scale of (38,38). How precision and scale are set depends on the field's source: Existing database tables: Precision and scale match the source column. To change these values, edit the column definition directly in the database. Generated database tables: Default precision and scale is (18,6) for the field. To change these values, edit the column definition directly in the database. Service-backed record types: Default precision and scale is (18,6) and cannot be changed. Sync-time custom record fields: Appian suggests default scale and precision values based on your custom field expression. You can adjust the precision and scale as needed. Real-time custom record fields don't require a defined precision and scale because they're only evaluated when referenced. Where you can use decimal data types You can use both decimal types across Appian, including in record fields, rule inputs, process variables, constants, expressions, functions, operators, and display components. However, Number (Decimal Precise) has some limitations. You cannot use Number (Decimal Precise) in the following areas: Salesforce-backed record types: You cannot use Number (Decimal Precise) in record types that use Salesforce as the source. Custom data types and data stores: You cannot use Number (Decimal Precise) in Custom Data Types (CDTs) or data stores (DSEs). When you save or re-import a CDT, Appian automatically adds a column definition to xsd:decimal fields to keep them as Number (Decimal Floating) and maintain consistency in your database columns. Primary keys on synced record types: You cannot use a Number (Decimal Precise) field as the primary key on a synced record type. DOUBLE source fields: You cannot map a source field of type DOUBLE to a record field of type Number (Decimal Precise). Map DOUBLE source fields to Number (Decimal Floating) instead. Scientific notation: You cannot define a literal Number (Decimal Precise) value using scientific notation. JSON strings still support scientific notation. Decimal literals in expressions When you enter a number in an expression editor, Appian assigns the number a data type. Decimal literals are Number (Decimal Precise) by default and display without a prefix. Appian adds a prefix to a literal number only in the following cases: f#: Appears before an existing literal decimal to indicate that the number is Number (Decimal Floating). To convert an existing floating-point literal to Number (Decimal Precise), delete the f# prefix from the number in the expression. i#: Appears before a literal integer that falls outside the bounds of the Number (Integer) type. When you type a new integer that exceeds these bounds, it defaults to Number (Decimal Precise). Conversion and casting behavior Number (Decimal Precise) and Number (Decimal Floating) convert to and from other data types using explicit rules that determine whether precision is preserved. For example, casting Number (Decimal Precise) to Number (Decimal Floating) can lose precision, and an operation that combines the two types returns Number (Decimal Floating). For the complete rules—including how each decimal type casts to and from integers and text, and how the types behave when combined with other numeric types—see Cast to Number (Decimal Precise) and Cast to Number (Decimal Floating). Feedback Was this page helpful? SHARE FEEDBACK Loading...