Free cookie consent management tool by TermsFeed

todecimal() Function

On This Page

Function

todecimal( value )

Converts a value to Decimal (double-precision floating-point number).

Parameters

Keyword Type Description

value

Any Type

Value to convert.

Returns

Decimal

Usage considerations

Automatic conversion of large numbers

Numbers less than -10,000,000 and greater than 10,000,000 are represented in scientific notation.

Use with arrays

When operating on arrays, it is not necessary to use apply with todecimal. If multiple parameters are passed, or one parameter is an Array, todecimal will return a Decimal Array.

Commas in arguments

When a value containing a comma is passed as a string, the comma is stripped and the value is treated as a single number. When multiple numeric values are passed separated by commas, each value is treated as a separate argument and the function returns a list.

For example:

  • todecimal("386,255.07") returns 386255.07 because the comma inside the string is stripped and the entire value is treated as one number.
  • todecimal(386,255.07) returns {386.0, 255.07} because 386 and 255.07 are treated as two separate numeric arguments.

Examples

Convert strings to decimals

1
todecimal("3.6")

Returns 3.6.

1
todecimal("1.123456789")

Returns 1.123457.

1
todecimal("2ab4.57cd3")

Returns 24.573.

1
todecimal("2ab4.57cd3")

Returns 24.573.

1
todecimal("1239329332")

Returns 1.239329e+09.

1
todecimal("string")

Returns null.

Convert a list of strings to a list of decimals

1
2
3
4
{
todecimal("3.6", "4.2"),
todecimal({"3.6", "4.2"})
}

Returns {3.6, 4.2, 3.6, 4.2}. The value can be one or more single values or a list of values.

Comma behavior in strings vs. numeric input

1
todecimal("386,255.07")

Returns 386255.07. The comma inside the string is stripped and the value is treated as a single number.

1
todecimal(386,255.07)

Returns {386.0, 255.07}. The two numeric values are treated as separate arguments, returning a list.

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Interfaces Compatible
Sync-Time Custom Record Fields Compatible

Can be used to create a custom record field that only evaluates at sync time.

Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Compatible
Process Events Compatible

Can be used to configure a process event node, such as a start event or timer event.

Process Autoscaling Compatible

Can be used in autoscaled processes.

Event Consumer Filter Conditions Compatible

Can be used in filter conditions.

Event Consumer Event Handlers Compatible

Can be used in event handler expressions.

Feedback