Digibee Documentation
Request documentationBook a demo
English
English
  • Quick start
  • Highlights
    • Release notes
      • Release notes 2025
        • May
        • April
        • March
        • February
        • January
      • Release notes 2024
        • December
        • November
        • October
        • September
        • August
          • Connectors release 08/20/2024
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2023
        • December
        • November
        • October
        • September
        • August
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2022
        • December
        • November
        • October
        • September
        • August
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2021
      • Release notes 2020
    • AI Pair Programmer
    • Digibeectl
      • Getting started
        • How to install Digibeectl on Windows
      • Digibeectl syntax
      • Digibeectl operations
  • Digibee in action
    • Use Cases in Action
      • Improving integration performance with API pagination
      • Automating file storage with Digibee
      • Reprocessing strategy in event-driven integrations
      • Key practices for securing sensitive information in pipelines with Digibee
      • OAuth2 for secure API access
      • Secure your APIs with JWT in Digibee
      • Integration best practices for developers on the Digibee Integration Platform
      • How to use Event-driven architecture on the Digibee Integration Platform
      • Dynamic file download with Digibee
      • Microservices: Circuit Breaker pattern for improving resilience
      • Error handling strategy in event-driven integrations
    • Troubleshooting
      • Integration guidance
        • How to resolve common pipeline issues
        • How to resolve Error 409: “You cannot update a pipeline that is not on draft mode”
        • How to resolve the "Pipeline execution was aborted" error
        • Integrated authentication with Microsoft Entra ID
        • How to resolve the "Failed to initialize pool: ONS configuration failed" error
        • How to perform IP address mapping with Progress database
        • How to build integration flows that send error notifications
        • How to send logs to external services
        • How JSONPath differs in connectors and the Execution panel
        • Using JSONPath to validate numbers with specific initial digits
        • How to analyze the "Network error: Failed to fetch" in the Execution panel
        • How to handle request payloads larger than 5MB
        • How to configure Microsoft Entra ID to display groups on the Digibee Integration Platform
        • How to build an HL7 message
      • Connectors behavior and configuration
        • Timeout in the Pipeline Executor connector
        • How to use DISTINCT and COUNT in the Object Store
        • Understanding @@DGB_TRUNCATED@@ on the Digibee Integration Platform
        • How to resolve names without a DNS - REST, SOAP, SAP (web protocols)
        • How to read and write files inside a folder
        • AuthToken Reuse for Salesforce connector
        • How to resolve the "Invalid payload" error in API Integration
        • Supported databases
          • Functions and uses for databases
      • Connectors implementation and usage examples
        • Google Storage: Usage scenarios
        • DB V2: Usage scenarios
        • For Each: Usage example
        • Template and its uses
        • Digibee JWT implementation
        • Email V1: Usage example (Deprecated)
      • JOLT applications
        • Transformer: Getting to know JOLT
        • Transformer: Transformations with JOLT
        • Transformer: Add values to list elements
        • Transformer: Operations overview
        • Transformer: Date formatting using split and concat
        • Transformer: Simple IF-ELSE logic with JOLT
      • Platform access and performance tips
        • How to solve login problems on the Digibee Integration Platform
        • How to receive updates from Digibee Status Page
        • How to clean the Digibee Integration Platform cache
      • Governance troubleshooting guidance
        • How to consume Internal API pipelines using ZTNA
        • How to use Internal API with and without a VPN
        • How to generate, convert, and register SSH Keys
        • mTLS authentication
          • How to configure mTLS on the Digibee Integration Platform
          • FAQs: Certificates in mTLS
        • How to connect Digibee to Oracle RAC
        • How to connect Digibee to SAP
        • How to connect Digibee to MongoDB Atlas using VPN
        • How to manage IPs on the Digibee Integration Platform
        • Configuring the Dropbox account
        • How to use your Gmail account with the Digibee email component (SMTP)
        • How to use the CORS policy on the Digibee Integration Platform
      • Deployment scenarios
        • Solving the “Out of memory” errors in deployment
        • Warning of route conflicts
    • Best practices
      • Best practices for building a pipeline
      • Best practices on validating messages in a consumer pipeline
      • Avoiding loops and maximizing pipeline efficiency
      • Naming: Global, Accounts, and API Keys
      • Pagination tutorial
        • Pagination tutorial - part 1
        • Pagination tutorial - part 2
        • Pagination tutorial - part 3
        • Pagination tutorial - part 4
      • Pagination example
      • Event-driven architecture
      • Notification model in event-driven integrations
      • OAuth2 integration model with Digibee
      • Best practices for error handling in pipelines
    • Digibee Academy
      • Integration Developer Bootcamp
  • Reference guides
    • Connectors
      • AWS
        • S3 Storage
        • SQS
        • AWS Secrets Manager
        • AWS Athena
        • AWS CloudWatch
        • AWS Elastic Container Service (ECS)
        • AWS Eventbridge
        • AWS Identity and Access Management (IAM)
        • AWS Kinesis
        • AWS Kinesis Firehose
        • AWS Key Management Service (KMS)
        • AWS Lambda
        • AWS MQ
        • AWS Simple Email Service (SES)
        • AWS Simple Notification System (SNS)
        • AWS Security Token Service (STS)
        • AWS Translate
      • Azure
        • Azure CosmosDB
        • Azure Event Hubs
        • Azure Key Vault
        • Azure ServiceBus
        • Azure Storage DataLake Service
        • Azure Storage Queue Service
      • Enterprise applications
        • SAP
        • Salesforce
        • Braintree
        • Facebook
        • GitHub
        • Jira
        • ServiceNow
        • Slack
        • Telegram
        • Twilio
        • WhatsApp
        • Wordpress
        • Workday
        • Zendesk
      • File storage
        • Blob Storage (Azure)
        • Digibee Storage
        • Dropbox
        • FTP
        • Google Drive
        • Google Storage
        • OneDrive
        • SFTP
        • WebDav V2
        • WebDav (Deprecated)
      • Files
        • Append Files
        • Avro File Reader
        • Avro File Writer
        • CSV to Excel
        • Excel
        • File Reader
        • File Writer
        • GZIP V2
        • GZIP V1 (Deprecated)
        • Parquet File Reader
        • Parquet File Writer
        • Stream Avro File Reader
        • Stream Excel
        • Stream File Reader
        • Stream File Reader Pattern
        • Stream JSON File Reader
        • Stream Parquet File Reader
        • Stream XML File Reader
        • XML Schema Validator
        • ZIP File
        • NFS
      • Flow
        • Delayer
      • Google/GCP
        • Google BigQuery
        • Google BigQuery Standard SQL
        • Google Calendar
        • Google Cloud Functions
        • Google Mail
        • Google PubSub
        • Google Secret Manager
        • Google Sheets
      • Industry solutions
        • FHIR (Beta)
        • Gupy Public API
        • HL7
        • HubSpot: Sales and CMS
        • Mailgun API
        • Oracle NetSuite (Beta)
        • Orderful
        • Protheus: Billing and Inventory of Cost
      • Logic
        • Block Execution
        • Choice
        • Do While
        • For Each
        • Retry
        • Parallel Execution
      • Queues and messaging
        • Event Publisher
        • JMS
        • Kafka
        • RabbitMQ
      • Security
        • AES Cryptography
        • Asymmetric Cryptography
        • CMS
        • Digital Signature
        • JWT (Deprecated)
        • JWT V2
        • Google IAP Token
        • Hash
        • Digibee JWT (Generate and Decode)
        • LDAP
        • PBE Cryptography
        • PGP
        • RSA Cryptography
        • Symmetric Cryptography
      • Structured data
        • CassandraDB
        • DB V2
        • DB V1 (Deprecated)
        • DynamoDB
        • Google Big Table
        • Memcached
        • MongoDB
        • Object Store
        • Relationship
        • Session Management
        • Stored Procedure
        • Stream DB V3
        • Stream DB V1 (Deprecated)
        • ArangoDb
        • Caffeine Cache
        • Caffeine LoadCache
        • Couchbase
        • CouchDB
        • Ehcache
        • InfluxDB
      • Tools
        • Assert V2
        • Assert V1 (Deprecated)
        • Base64
        • CSV to JSON V2
        • CSV to JSON V1 (Deprecated)
        • HL7 Message Transformer (Beta)
        • HTML to PDF
        • Transformer (JOLT) V2
        • JSLT
        • JSON String to JSON Transformer
        • JSON to JSON String Transformer
        • JSON to XML Transformer
        • JSON to CSV V2
        • JSON to CSV Transformer (Deprecated)
        • JSON Path Transformer V2
        • JSON Path Transformer
        • JSON Transformer
        • Log
        • Pipeline Executor
        • QuickFix (Beta)
        • SSH Remote Command
        • Script (JavaScript)
        • Secure PDF
        • Store Account
        • Template Transformer
        • Throw Error
        • Transformer (JOLT)
        • Validator V1 (Deprecated)
        • Validator V2
        • XML to JSON Transformer
        • XML Transformer
        • JSON Generator (Mock)
      • Web protocols
        • Email V2
        • Email V1 (Deprecated)
        • REST V2
        • REST V1 (Deprecated)
        • SOAP V1 (Deprecated)
        • SOAP V2
        • SOAP V3
        • WGet (Download HTTP)
        • gRPC
    • Triggers
      • Web Protocols
        • API Trigger
        • Email Trigger
        • Email Trigger V2
        • HTTP Trigger
        • HTTP File Trigger
          • HTTP File Trigger - Downloads
          • HTTP File Trigger - Uploads
        • REST Trigger
      • Scheduling
        • Scheduler Trigger
      • Messaging and Events
        • Event Trigger
        • JMS Trigger
        • Kafka Trigger
        • RabbitMQ Trigger
      • Others
        • DynamoDB Streams Trigger
        • HL7 Trigger
        • Salesforce Trigger - Events
    • Double Braces
      • How to reference data using Double Braces
      • Double Braces functions
        • Math functions
        • Utilities functions
        • Numerical functions
        • String functions
        • JSON functions
        • Date functions
        • Comparison functions
        • File functions
        • Conditional functions
      • Double Braces autocomplete
  • Development cycle
    • Build
      • Canvas
        • AI Assistant
        • Smart Connector User Experience
        • Execution panel
        • Design and Inspect Mode
        • Linter: Canvas building validation
        • Connector Mocking
      • Pipeline
        • How to create a pipeline
        • How to scaffold a pipeline using an OpenAPI specification
        • How to create a project
        • Pipeline version history
        • Pipeline versioning
        • Messages processing
        • Subpipelines
      • Capsules
        • How to use Capsules
          • How to create a Capsule collection
            • Capsule header dimensions
          • How to create a Capsule group
          • How to configure a Capsule
          • How to build a Capsule
          • How to test a Capsule
          • How to save a Capsule
          • How to publish a Capsule
          • How to change a Capsule collection or group
          • How to archive and restore a Capsule
        • Capsules versioning
        • Public capsules
          • SAP
          • Digibee Tools
          • Google Sheets
          • Gupy
          • Send notifications via email
          • Totvs Live
          • Canvas LMS
        • AI Assistant for Capsules Docs Generation
    • Run
      • Run concepts
        • Autoscalling
      • Deployment
        • Deploying a pipeline
        • How to redeploy a pipeline
        • How to promote pipelines across environments
        • How to check the pipeline deployment History
        • How to rollback to a previous deployment version
        • Using deployment history advanced functions
        • Pipeline deployment status
      • How warnings work on pipelines in Run
    • Monitor
      • Monitor Insights (Beta)
      • Completed executions
        • Pipeline execution logs download
      • Pipeline logs
      • Pipeline Metrics
        • Pipeline Metrics API
          • How to set up Digibee API metrics with Datadog
          • How to set up Digibee API metrics with Prometheus
        • Connector Latency
      • Alerts
        • How to create an alert
        • How to edit an alert
        • How to activate, deactivate or duplicate an alert
        • How to delete an alert
        • How to configure alerts on Slack
        • How to configure alerts on Telegram
        • How to configure alerts through a webhook
        • Available metrics
        • Best practices about alerts
        • Use cases for alerts
      • VPN connections monitoring
        • Alerts for VPN metrics
  • Connectivity management
    • Connectivity
    • Zero Trust Network Access (ZTNA)
      • Prerequisites for using ZTNA
      • How to view connections (Edge Routers)
      • How to view the Network Mappings associated with an Edge Router
      • How to add new ZTNA connections (Edge Routers)
      • How to delete connections (Edge Routers)
      • How to view routes (Network Mapping)
      • How to add new routes (Network Mapping)
      • How to add routes in batch for ZTNA
      • How to edit routes (Network Mapping)
      • How to delete routes (Network Mapping)
      • How to generate new keys (Edge Router)
      • How to change the environment of Edge routers
      • ZTNA Inverse Flow
      • ZTNA Groups
    • Virtual Private Network (VPN)
  • Platform administration
    • Administration
      • Audit
      • Access control
        • Users
        • Groups
        • Roles
          • List of permissions by service
          • Roles and responsibilities: Governance and key stakeholder identification
      • Identity provider integration
        • How to integrate an identity provider
        • Authentication rules
        • Integration of IdP groups with Digibee groups
          • How to create a group integration
          • How to test a group integration
          • How to enable group integrations
          • How to edit a group integration
          • How to delete a group integration
      • User authentication and authorization
        • How to activate and deactivate two-factor authentication
        • Login flow
      • Organization groups
    • Settings
      • Globals
        • How to create Globals
        • How to edit or delete Globals
        • How to use Globals
      • Accounts
        • Configuring each account type
        • Monitor changes to account settings in deployed pipelines
        • OAuth2 Architecture
          • Registration of new OAuth providers
      • Consumers (API Keys)
      • Relationship model
      • Multi-Instance
        • Deploying a multi-instance pipeline
      • Log Streaming
        • How to use Log Streaming with Datadog
    • Governance
      • Policies
        • Security
          • Internal API access policy
          • External API access policy
          • Sensitive fields policy
        • Transformation
          • Custom HTTP header
          • CORS HTTP header
        • Limit of Replicas policy
    • Licensing
      • Licensing models
        • Consumption Based model
      • Capacity and quotas
      • License consumption
    • Digibee APIs
      • How to create API credentials
  • Digibee concepts
    • Pipeline Engine
      • Digibee Integration Platform Pipeline Engine v2
      • Support Dynamic Accounts (Restricted Beta)
    • Introduction to ZTNA
  • Help & FAQ
    • Digibee Customer Support
    • Request documentation, suggest features, or send feedback
    • Beta Program
    • Security and compliance
    • About Digibee
Powered by GitBook
On this page
  • FORMATNUMBER
  • Syntax
  • Pattern
  • Function in use
  • TODOUBLE
  • Syntax
  • TOINT
  • Syntax
  • TOLONG
  • Syntax
  • TONUMBER
  • Syntax
  • RANDOMNUMBERS
  • Syntax

Was this helpful?

  1. Reference guides
  2. Double Braces
  3. Double Braces functions

Numerical functions

Learn about numerical functions in the Digibee Integration Platform and how to use them.

PreviousUtilities functionsNextString functions

Last updated 4 months ago

Was this helpful?

The numerical functions treat numbers and are available for components that support Double Braces expressions. To know how to provide information to the components using this resource, refer to .

FORMATNUMBER

The FORMATNUMBER function is used to format numbers in a text format.

Syntax

FORMATNUMBER(value, "pattern", "locale":optional, "rounding":optional)
  • value: the number to be formatted (can be a number or string).

  • pattern: the pattern to be used. It includes both a positive and a negative subpattern, such as "#,##0.00;(#,##0.00)". Each subpattern consists of a prefix, a numeric part, and a suffix. The presence of the negative subpattern is optional; if it is not specified, the positive subpattern preceded by the localized minus sign ('-' in most locales) serves as the negative subpattern. Therefore, "0.00" alone is equivalent to "0.00;-0.00".

  • locale: the specification of the locale must be taken into account when generating numbers. If the locale isn't defined, en-us is taken into account.

  • rounding: the rounding type to be used: UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN. The default is HALF_EVEN

Pattern

Below you will find the special character patterns accepted by the function, which are taken from the .

Symbol
Location
Localized?
Meaning

0

Number

Yes

Digit

#

Number

Yes

Digit, zero shows as absent

.

Number

Yes

Decimal separator or monetary decimal separator

-

Number

Yes

Minus sign

,

Number

Yes

Grouping separator

E

Number

Yes

Separates mantissa and exponent in scientific notation

;

Subpattern boundary

Yes

Separates positive and negative subpatterns

%

Prefix or suffix

Yes

Multiply by 100 and show as percentage

Some other pattern examples:

Pattern
Number
Formatted string

###.###

123.456

123.456

###.#

123.456

123.5

###,###.##

123456.789

123,456.79000

###

9.95

009.95

##0.###

0.95

0.95

Function in use

Example 1:

Let's assume we have the number:

{
    "num": 3.8454
}

And execute the following test:

{
  "test_UP": {{ FORMATNUMBER(message.num,"#.###", null, "UP") }},
  "test_DOWN": {{ FORMATNUMBER(message.num,"#.###", null, "DOWN") }},
  "test_CEILING": {{ FORMATNUMBER(message.num,"#.###", null, "CEILING") }},
  "test_FLOOR": {{ FORMATNUMBER(message.num,"#.###", null, "FLOOR") }},
  "test_HALF_UP": {{ FORMATNUMBER(message.num,"#.###", null, "HALF_UP") }},
  "test_HALF_DOWN": {{ FORMATNUMBER(message.num,"#.###", null, "HALF_DOWN") }},
  "test_HALF_EVEN": {{ FORMATNUMBER(message.num,"#.###", null, "HALF_EVEN") }}
}

This will be the result:

{
  "test_UP": "3.846",
  "test_DOWN": "3.845",
  "test_CEILING": "3.846",
  "test_FLOOR": "3.845",
  "test_HALF_UP": "3.845",
  "test_HALF_DOWN": "3.845",
  "test_HALF_EVEN": "3.845"
}

Example 2:

Now let’s suppose we have these two numbers:

{
  "number": 123456.9123,
  "negative": -987.123
}

And apply the following conversions:

{
  "number-US":{{ FORMATNUMBER(message.number, "###,###.###", "us-EN") }},
  "number-BR":{{ FORMATNUMBER(message.number, "###,###.###", "pt-BR") }},
  "number-BR-1":{{ FORMATNUMBER(message.number, "###,###.#", "pt-BR") }},
  "number-positive-BR-a": {{ FORMATNUMBER(message.number, "'+'###,###.###;'-'###,###.###", "pt-BR") }},
  "number-negative-BR": {{ FORMATNUMBER(message.negative, "###,###.###'C';###,###.###'D'", "pt-BR") }},
  "number-negative-BR-a": {{ FORMATNUMBER(message.negative, "'+'###,###.###;'-'###,###.###", "pt-BR") }}
}

This will be the result:

{
  "number-US": "123,456.912",
  "number-BR": "123.456,912",
  "number-BR-1": "123.456,9",
  "number-positive-BR-a": "+123.456,912",
  "number-negative-BR": "987,123D",
  "number-negative-BR-a": "-987,123"
}

TODOUBLE

By using Double Braces, you can combine the function with the access to the input JSON element of a component.

The TODOUBLE function is applied to return the double value of a whole number.

Syntax

TODOUBLE(num1)

Example:

{
    "a": 12
}
{
    "doub": {{ TODOUBLE( message.a ) }}
}

The return of this function will be 12.0.

TOINT

By using Double Braces, you can combine the function with the access to the input JSON element of a component.

The TOINT function is applied to return the whole number of a double number.

Syntax

TOINT(num1)

Example:

{
    "a": 12.345
}
{
    "int": {{ TOINT( message.a ) }}
}

The return of this function will be 12.

TOLONG

By using Double Braces, you can have a LONG-type value returned from a number. It's possible to receive not only a string, but also a number as an input parameter.

Syntax

TOLONG(num1)

Example:

{
    "a": 12.345
}
{
    "long": {{ TOLONG( message.a ) }}
}

The return of this function will be 12.

TONUMBER

The TONUMBER function allows you to convert a string value to a numeric value based on its source format and locale.

Syntax

TONUMBER(string, formatSource, localeSource?, asInteger?)

The parameters indicated with "?" are optionals.

  • string: the string to be converted

  • formatSource: source format of the string. Eg.: "###.###", "###.#", "###,###.##"

  • localeSource: the string locale, which if not informed, will be considered "en-us"

  • asInteger: boolean value that indicates if the string must be converted to an integer numeric value. In case it is not defined, the default value is false.

Let's say you need to convert two strings referring to a generic numeric value and a monetary value:

{
    "generic": "150.33",
    "currency": "R$ 300.754,15"
}

Applying the conversion:

{
    "generic": {{ TONUMBER(message.generic, "###.##") }},
    "currency": {{ TONUMBER(message.currency, "'R$ '###,###.##", "pt-br") }}
}

The result will be:

{
    "generic": 150.33,
    "currency": 300754.15
}

Other formatting examples:

String
Format
Numerical

"123.456"

###.#

123.5

"009.95"

000.###

9.95

"0.95"

##0.###

0.95

"-300"

'-'###

-300

RANDOMNUMBERS

The RANDOMNUMBERS function allows you to generate random integer numbers based on a range of values.

Syntax

RANDOMNUMBERS(minValue, maxValue)

Let's say you need to generate a random number between 0 and 50000.

Generate the number:

{
    "randomNumber": {{ RANDOMNUMBERS(0, 50000) }}
}

The result will be:

{
    "randomNumber": 37122
}

The values that define the range are inclusive.

The function has a numerical limitation and only accepts values between the range of -9223372036854775808 to 9223372036854775807. Any other value out of those limits will result in an unpredictable execution of the function.

Double Braces Functions
Java documentation