← Formatting

[Numbers] Format Currency with Formatting API

Pipedream makes it easy to connect APIs for Formatting and 2,000+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
[Numbers] Format Currency with the Formatting API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
4 min
Watch now ➜

Trusted by 800,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

Create a workflow to [Numbers] Format Currency with the Formatting API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the [Numbers] Format Currency action
    1. Connect your Formatting account
    2. Configure Input
    3. Select a Currency
    4. Select a Currency Format
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

[Numbers] Format Currency with Formatting API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Formatting
 
Try it
[Numbers] Format Currency with Formatting API on New Submission from Typeform API
Typeform + Formatting
 
Try it
[Numbers] Format Currency with Formatting API on Custom Events from Zoom API
Zoom + Formatting
 
Try it
[Numbers] Format Currency with Formatting API on New Submission (Instant) from Jotform API
Jotform + Formatting
 
Try it
[Numbers] Format Currency with Formatting API on New Custom Webhook Events from Stripe API
Stripe + Formatting
 
Try it

Details

This is a pre-built, source-available component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

[Numbers] Format Currency on Formatting
Description:Format a number as a currency
Version:0.0.4
Key:formatting-format-currency

Code

import { defineAction } from "@pipedream/types";
import { ConfigurationError } from "@pipedream/platform";
import { CURRENCY_OPTIONS } from "../../common/numbers/currencies.mjs";
import { CURRENCY_FORMAT_OPTIONS } from "../../common/numbers/currencyFormats.mjs";
import formatNumber from "../../common/numbers/formatNumber.mjs";
import app from "../../app/formatting.app.mjs";
export default defineAction({
    name: "[Numbers] Format Currency",
    description: "Format a number as a currency",
    key: "formatting-format-currency",
    version: "0.0.4",
    type: "action",
    props: {
        app,
        input: {
            label: "Input",
            description: "Number you would like to format as a currency.",
            type: "string",
        },
        currency: {
            label: "Currency",
            description: "Specify the currency to be used for formatting",
            type: "string",
            options: CURRENCY_OPTIONS,
        },
        currencyFormat: {
            label: "Currency Format",
            description: "Specify the format to be used for the currency formatting. Use the unicode currency symbol `¤` for special formatting options. [Formatting rules can be found here](http://www.unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns)",
            type: "string",
            options: CURRENCY_FORMAT_OPTIONS,
        },
    },
    async run({ $ }) {
        const { currency, currencyFormat, } = this;
        const input = this.input.toString();
        const [isoCode, currencySymbol, currencyName,] = currency.split(" - ");
        let result = (currencyFormat.startsWith("¤") && currencySymbol) || "";
        const [integer, decimal,] = input.split(input.includes(".")
            ? "."
            : ",");
        if (isNaN(Number(integer))) {
            throw new ConfigurationError("**Invalid number** - please check your input.");
        }
        const numberString = formatNumber(integer, (decimal?.length > 1
            ? decimal
            : (decimal ?? "0") + "0"), currencyFormat.includes(",")
            ? ","
            : "");
        result += numberString;
        switch (currencyFormat.match(/¤+$/g)?.[0].length) {
            default:
                break;
            // ¤¤ - ISO currency symbol: USD, BRL, etc.
            case 2:
                result += ` ${isoCode}`;
                break;
            // ¤¤¤ - Currency display name: United States dollar, Brazilian real, etc.
            case 3:
                result += ` ${currencyName}`;
                break;
        }
        $.export("$summary", "Successfully formatted as currency");
        return result;
    },
});

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
FormattingappappThis component uses the Formatting app.
Inputinputstring

Number you would like to format as a currency.

CurrencycurrencystringSelect a value from the drop down menu:{ "label": "United States dollar", "value": "USD - $ - United States dollar" }{ "label": "Euro", "value": "EUR - € - Euro" }{ "label": "Japanese yen", "value": "JPY - ¥ - Japanese yen" }{ "label": "Brazilian real", "value": "BRL - R$ - Brazilian real" }{ "label": "Russian ruble", "value": "RUB - ₽ - Russian ruble" }{ "label": "Sterling", "value": "GBP - £ - Sterling" }{ "label": "Canadian dollar", "value": "CAD - $ - Canadian dollar" }{ "label": "Afghan afghani", "value": "AFN - Af - Afghan afghani" }{ "label": "Albanian lek", "value": "ALL - Lek - Albanian lek" }{ "label": "Algerian dinar", "value": "DZD - DA - Algerian dinar" }{ "label": "Angolan kwanza", "value": "AOA - Kz - Angolan kwanza" }{ "label": "Eastern Caribbean dollar", "value": "XCD - $ - Eastern Caribbean dollar" }{ "label": "Argentine peso", "value": "ARS - $ - Argentine peso" }{ "label": "Armenian dram", "value": "AMD - ֏ - Armenian dram" }{ "label": "Aruban florin", "value": "AWG - ƒ - Aruban florin" }{ "label": "Saint Helena pound", "value": "SHP - £ - Saint Helena pound" }{ "label": "Australian dollar", "value": "AUD - $ - Australian dollar" }{ "label": "Azerbaijani manat", "value": "AZN - ₼ - Azerbaijani manat" }{ "label": "Bahamian dollar", "value": "BSD - $ - Bahamian dollar" }{ "label": "Bahraini dinar", "value": "BHD - BD - Bahraini dinar" }{ "label": "Bangladeshi taka", "value": "BDT - ৳ - Bangladeshi taka" }{ "label": "Barbadian dollar", "value": "BBD - $ - Barbadian dollar" }{ "label": "Belarusian ruble", "value": "BYN - Rbl - Belarusian ruble" }{ "label": "Belize dollar", "value": "BZD - $ - Belize dollar" }{ "label": "West African CFA franc", "value": "XOF - Fr - West African CFA franc" }{ "label": "Bermudian dollar", "value": "BMD - $ - Bermudian dollar" }{ "label": "Bhutanese ngultrum", "value": "BTN - Nu - Bhutanese ngultrum" }{ "label": "Indian rupee", "value": "INR - ₹ - Indian rupee" }{ "label": "Bolivian boliviano", "value": "BOB - Bs - Bolivian boliviano" }{ "label": "Bosnia and Herzegovina convertible mark", "value": "BAM - KM - Bosnia and Herzegovina convertible mark" }{ "label": "Botswana pula", "value": "BWP - P - Botswana pula" }{ "label": "Brunei dollar", "value": "BND - $ - Brunei dollar" }{ "label": "Singapore dollar", "value": "SGD - $ - Singapore dollar" }{ "label": "Bulgarian lev", "value": "BGN - Lev - Bulgarian lev" }{ "label": "Burundian franc", "value": "BIF - Fr - Burundian franc" }{ "label": "Cambodian riel", "value": "KHR - CR - Cambodian riel" }{ "label": "Central African CFA franc", "value": "XAF - Fr - Central African CFA franc" }{ "label": "Cape Verdean escudo", "value": "CVE - $ - Cape Verdean escudo" }{ "label": "Cayman Islands dollar", "value": "KYD - $ - Cayman Islands dollar" }{ "label": "Chilean peso", "value": "CLP - $ - Chilean peso" }{ "label": "Renminbi", "value": "CNY - ¥ - Renminbi" }{ "label": "Colombian peso", "value": "COP - $ - Colombian peso" }{ "label": "Comorian franc", "value": "KMF - Fr - Comorian franc" }{ "label": "Congolese franc", "value": "CDF - Fr - Congolese franc" }{ "label": "New Zealand dollar", "value": "NZD - $ - New Zealand dollar" }{ "label": "Costa Rican colón", "value": "CRC - ₡ - Costa Rican colón" }{ "label": "Cuban peso", "value": "CUP - $ - Cuban peso" }{ "label": "Netherlands Antillean guilder", "value": "ANG - ƒ - Netherlands Antillean guilder" }{ "label": "Czech koruna", "value": "CZK - Kč - Czech koruna" }{ "label": "Danish krone", "value": "DKK - kr - Danish krone" }{ "label": "Djiboutian franc", "value": "DJF - Fr - Djiboutian franc" }{ "label": "Dominican peso", "value": "DOP - $ - Dominican peso" }{ "label": "Egyptian pound", "value": "EGP - LE - Egyptian pound" }{ "label": "Eritrean nakfa", "value": "ERN - Nkf - Eritrean nakfa" }{ "label": "Swazi lilangeni", "value": "SZL - L - Swazi lilangeni" }{ "label": "South African rand", "value": "ZAR - R - South African rand" }{ "label": "Ethiopian birr", "value": "ETB - Br - Ethiopian birr" }{ "label": "Falkland Islands pound", "value": "FKP - £ - Falkland Islands pound" }{ "label": "Fijian dollar", "value": "FJD - $ - Fijian dollar" }{ "label": "CFP franc", "value": "XPF - Fr - CFP franc" }{ "label": "Gambian dalasi", "value": "GMD - D - Gambian dalasi" }{ "label": "Georgian lari", "value": "GEL - ₾ - Georgian lari" }{ "label": "Ghanaian cedi", "value": "GHS - ₵ - Ghanaian cedi" }{ "label": "Gibraltar pound", "value": "GIP - £ - Gibraltar pound" }{ "label": "Guatemalan quetzal", "value": "GTQ - Q - Guatemalan quetzal" }{ "label": "Guinean franc", "value": "GNF - Fr - Guinean franc" }{ "label": "Guyanese dollar", "value": "GYD - $ - Guyanese dollar" }{ "label": "Haitian gourde", "value": "HTG - G - Haitian gourde" }{ "label": "Honduran lempira", "value": "HNL - L - Honduran lempira" }{ "label": "Hong Kong dollar", "value": "HKD - $ - Hong Kong dollar" }{ "label": "Hungarian forint", "value": "HUF - Ft - Hungarian forint" }{ "label": "Icelandic króna", "value": "ISK - kr - Icelandic króna" }{ "label": "Indonesian rupiah", "value": "IDR - Rp - Indonesian rupiah" }{ "label": "Iranian rial", "value": "IRR - Rl - Iranian rial" }{ "label": "Iraqi dinar", "value": "IQD - ID - Iraqi dinar" }{ "label": "Israeli new shekel", "value": "ILS - ₪ - Israeli new shekel" }{ "label": "Jamaican dollar", "value": "JMD - $ - Jamaican dollar" }{ "label": "Jordanian dinar", "value": "JOD - JD - Jordanian dinar" }{ "label": "Kazakhstani tenge", "value": "KZT - ₸ - Kazakhstani tenge" }{ "label": "Kenyan shilling", "value": "KES - Sh - Kenyan shilling" }{ "label": "North Korean won", "value": "KPW - ₩ - North Korean won" }{ "label": "South Korean won", "value": "KRW - ₩ - South Korean won" }{ "label": "Kuwaiti dinar", "value": "KWD - KD - Kuwaiti dinar" }{ "label": "Kyrgyz som", "value": "KGS - som - Kyrgyz som" }{ "label": "Lao kip", "value": "LAK - ₭ - Lao kip" }{ "label": "Lebanese pound", "value": "LBP - LL - Lebanese pound" }{ "label": "Lesotho loti", "value": "LSL - L - Lesotho loti" }{ "label": "Liberian dollar", "value": "LRD - $ - Liberian dollar" }{ "label": "Libyan dinar", "value": "LYD - LD - Libyan dinar" }{ "label": "Swiss franc", "value": "CHF - Fr - Swiss franc" }{ "label": "Macanese pataca", "value": "MOP - MOP$ - Macanese pataca" }{ "label": "Malagasy ariary", "value": "MGA - Ar - Malagasy ariary" }{ "label": "Malawian kwacha", "value": "MWK - K - Malawian kwacha" }{ "label": "Malaysian ringgit", "value": "MYR - RM - Malaysian ringgit" }{ "label": "Maldivian rufiyaa", "value": "MVR - Rf - Maldivian rufiyaa" }{ "label": "Mauritanian ouguiya", "value": "MRU - UM - Mauritanian ouguiya" }{ "label": "Mauritian rupee", "value": "MUR - Re - Mauritian rupee" }{ "label": "Mexican peso", "value": "MXN - $ - Mexican peso" }{ "label": "Moldovan leu", "value": "MDL - Leu - Moldovan leu" }{ "label": "Mongolian tögrög", "value": "MNT - ₮ - Mongolian tögrög" }{ "label": "Moroccan dirham", "value": "MAD - DH - Moroccan dirham" }{ "label": "Mozambican metical", "value": "MZN - Mt - Mozambican metical" }{ "label": "Burmese kyat", "value": "MMK - K - Burmese kyat" }{ "label": "Namibian dollar", "value": "NAD - $ - Namibian dollar" }{ "label": "Nepalese rupee", "value": "NPR - Re - Nepalese rupee" }{ "label": "Nicaraguan córdoba", "value": "NIO - C$ - Nicaraguan córdoba" }{ "label": "Nigerian naira", "value": "NGN - ₦ - Nigerian naira" }{ "label": "Macedonian denar", "value": "MKD - DEN - Macedonian denar" }{ "label": "Turkish lira", "value": "TRY - ₺ - Turkish lira" }{ "label": "Norwegian krone", "value": "NOK - kr - Norwegian krone" }{ "label": "Omani rial", "value": "OMR - RO - Omani rial" }{ "label": "Pakistani rupee", "value": "PKR - Re - Pakistani rupee" }{ "label": "Panamanian balboa", "value": "PAB - B/ - Panamanian balboa" }{ "label": "Papua New Guinean kina", "value": "PGK - K - Papua New Guinean kina" }{ "label": "Paraguayan guaraní", "value": "PYG - ₲ - Paraguayan guaraní" }{ "label": "Peruvian sol", "value": "PEN - S/ - Peruvian sol" }{ "label": "Philippine peso", "value": "PHP - ₱ - Philippine peso" }{ "label": "Polish złoty", "value": "PLN - zł - Polish złoty" }{ "label": "Qatari riyal", "value": "QAR - QR - Qatari riyal" }{ "label": "Romanian leu", "value": "RON - Leu - Romanian leu" }{ "label": "Rwandan franc", "value": "RWF - Fr - Rwandan franc" }{ "label": "Samoan tālā", "value": "WST - $ - Samoan tālā" }{ "label": "São Tomé and Príncipe dobra", "value": "STN - Db - São Tomé and Príncipe dobra" }{ "label": "Saudi riyal", "value": "SAR - Rl - Saudi riyal" }{ "label": "Serbian dinar", "value": "RSD - DIN - Serbian dinar" }{ "label": "Seychellois rupee", "value": "SCR - Re - Seychellois rupee" }{ "label": "Sierra Leonean leone", "value": "SLE - Le - Sierra Leonean leone" }{ "label": "Solomon Islands dollar", "value": "SBD - $ - Solomon Islands dollar" }{ "label": "Somali shilling", "value": "SOS - Sh - Somali shilling" }{ "label": "Sri Lankan rupee", "value": "LKR - Re - Sri Lankan rupee" }{ "label": "Sudanese pound", "value": "SDG - LS - Sudanese pound" }{ "label": "Surinamese dollar", "value": "SRD - $ - Surinamese dollar" }{ "label": "Swedish krona", "value": "SEK - kr - Swedish krona" }{ "label": "Syrian pound", "value": "SYP - LS - Syrian pound" }{ "label": "New Taiwan dollar", "value": "TWD - $ - New Taiwan dollar" }{ "label": "Tajikistani somoni", "value": "TJS - SM - Tajikistani somoni" }{ "label": "Tanzanian shilling", "value": "TZS - Sh - Tanzanian shilling" }{ "label": "Thai baht", "value": "THB - ฿ - Thai baht" }{ "label": "Tongan pa'anga", "value": "TOP - T$ - Tongan pa'anga" }{ "label": "Trinidad and Tobago dollar", "value": "TTD - $ - Trinidad and Tobago dollar" }{ "label": "Tunisian dinar", "value": "TND - DT - Tunisian dinar" }{ "label": "Turkmenistani manat", "value": "TMT - m - Turkmenistani manat" }{ "label": "Ugandan shilling", "value": "UGX - Sh - Ugandan shilling" }{ "label": "Ukrainian hryvnia", "value": "UAH - ₴ - Ukrainian hryvnia" }{ "label": "United Arab Emirates dirham", "value": "AED - Dh - United Arab Emirates dirham" }{ "label": "Uruguayan peso", "value": "UYU - $ - Uruguayan peso" }{ "label": "Uzbekistani sum", "value": "UZS - soum - Uzbekistani sum" }{ "label": "Vanuatu vatu", "value": "VUV - VT - Vanuatu vatu" }{ "label": "Venezuelan sovereign bolívar", "value": "VES - Bs.S - Venezuelan sovereign bolívar" }{ "label": "Venezuelan digital bolívar", "value": "VED - Bs.D - Venezuelan digital bolívar" }{ "label": "Vietnamese đồng", "value": "VND - ₫ - Vietnamese đồng" }{ "label": "Yemeni rial", "value": "YER - Rl - Yemeni rial" }{ "label": "Zambian kwacha", "value": "ZMW - K - Zambian kwacha" }
Currency FormatcurrencyFormatstringSelect a value from the drop down menu:{ "label": "$1,000.00", "value": "¤#,##0.00" }{ "label": "$1,000.00 USD", "value": "¤#,##0.00 ¤¤" }{ "label": "$1,000.00 United States dollar", "value": "¤#,##0.00 ¤¤¤" }{ "label": "$1000.00", "value": "¤###0.00" }{ "label": "1,000.00", "value": "#,##0.00" }{ "label": "1000.00", "value": "###0.00" }

Authentication

The Formatting API does not require authentication.

About Formatting

Pre-built actions to make formatting and manipulating data within your workflows easier.

More Ways to Use Formatting

Actions

[Data] Convert JSON to String with the Formatting API

Convert an object to a JSON format string

 
Try it
[Data] Parse JSON with the Formatting API

Parse a JSON string

 
Try it
[Date/Time] Add/Subtract Time with the Formatting API

Add or subtract time from a given input

 
Try it
[Date/Time] Compare Dates with the Formatting API

Get the duration between two dates in days, hours, minutes, and seconds along with checking if they are the same.

 
Try it
[Date/Time] Format with the Formatting API

Format a date string to another date string

 
Try it

Explore Other Apps

1
-
24
of
2,000+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Salesforce (REST API)
Salesforce (REST API)
Web services API for interacting with Salesforce
HubSpot
HubSpot
HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Zoho CRM
Zoho CRM
Zoho CRM is an online Sales CRM software that manages your sales, marketing, and support in one CRM platform.
Stripe
Stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Shopify Developer App
Shopify Developer App
Shopify is a user-friendly e-commerce platform that helps small businesses build an online store and sell online through one streamlined dashboard.
WooCommerce
WooCommerce
WooCommerce is the open-source ecommerce platform for WordPress.
Snowflake
Snowflake
A data warehouse built for the cloud
MongoDB
MongoDB
MongoDB is an open source NoSQL database management program.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
ServiceNow
ServiceNow
The smarter way to workflow
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Microsoft Teams
Microsoft Teams
Microsoft Teams has communities, events, chats, channels, meetings, storage, tasks, and calendars in one place.