---
schema_version: "1"
id: 1b3898b344869a56326df4351abbb1051b2e7b6f0b6c75208a04cf7e035afa51
title: Convert Currency to a String in Salesforce Spiff
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_currency_string.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_currency_string.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b7923a972ceb05a273d8b65b0610e07fcf8ec4e478ebc46e7cbcdfeabb9308bc
description: To show currency values with formatting such as symbols and commas in Salesforce Spiff documents or statement cards, convert the currency field to a string data type.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Convert Currency to a String in Salesforce Spiff

To show currency values with formatting such as symbols and commas in Salesforce Spiff documents or statement cards, convert the currency field to a string data type.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d93582e76">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d93582e76 ">To modify currency in Spiff documents or statements:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d93582e76 ">
              <p>A Spiff <a href="https://help.salesforce.com/s/articleView?id=sales.spiff_users_roles_and_permissions.htm&amp;release=264.0.0&amp;type=5" title="Give users the appropriate level of access so they can be successful in Salesforce Spiff, and enforce the principle of least privilege. Assign a default role to each user, or create custom roles with access to specific Spiff functionality.">user role</a> with this permission turned on.</p>
              <p style="margin-bottom:0;">Documents: Edit OR Statements: Edit</p>
            </td>

          </tr>
        </tbody>
      </table>

1. Copy this code to a text editor.
    
    ```
    CurrencyFieldStringWithCommas
    concat(["$",CurrencyFieldString_M, CurrencyFieldString_K, CurrencyFieldString_H, CurrencyFieldString_Decimal])
    CurrencyFieldString_M
    if(CurrencyFieldStringIntLength<7,"",
    if(CurrencyFieldStringIntLength<10,concat([left(CurrencyFieldString,CurrencyFieldStringIntLength-6),","]),
    if(CurrencyFieldStringIntLength>=10,concat([left(CurrencyFieldString,CurrencyFieldStringIntLength-9),",",mid(CurrencyFieldString,CurrencyFieldStringIntLength-8,3),","]),
    "")))
    CurrencyFieldString_K
    if(CurrencyFieldStringIntLength<4,"",
    if(CurrencyFieldStringIntLength<7,concat([left(CurrencyFieldString,CurrencyFieldStringIntLength-3),","]),
    if(CurrencyFieldStringIntLength>=7,concat([mid(CurrencyFieldString,CurrencyFieldStringIntLength-5,3),","]),
    "")))
    CurrencyFieldString_H
    if(CurrencyFieldStringIntLength<4,left(CurrencyFieldString,3- (3-CurrencyFieldStringIntLength)),
    if(CurrencyFieldStringIntLength>=4,mid(CurrencyFieldString,CurrencyFieldStringIntLength-2,3),
    "0"))
    CurrencyFieldString_Decimal
    mid(concat([CurrencyFieldString,"0000"]),CurrencyFieldStringIntLength + 1, 3)
    CurrencyFieldStringIntLength
    search(".", CurrencyFieldString) -1
    CurrencyFieldString
    right(concat([CurrencyField]), len(concat([CurrencyField]))-4)
    ```
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/images/icon_tip.png)
    
    Tip If you know that you don't have a number larger than 999,000, remove the `CurrencyFieldString_M` line.
    
    If you want to apply the same logic to multiple fields and don't want to create seven fields per display field, use this code instead.
    
    ```
    CurrencyFieldStringWithCommas 
    concat(["$", 
    if(CurrencyFieldStringIntLength<4,
    left(CurrencyFieldString,3- (3-CurrencyFieldStringIntLength)),
    if(CurrencyFieldStringIntLength<7,
    concat([left(CurrencyFieldString,CurrencyFieldStringIntLength-3),",",
    mid(CurrencyFieldString,4+ (CurrencyFieldStringIntLength-6) ,3)]),
    concat([left(CurrencyFieldString,CurrencyFieldStringIntLength-6),",",
    mid(CurrencyFieldString,4+ (CurrencyFieldStringIntLength-9),3),",",
    mid(CurrencyFieldString,4+ (CurrencyFieldStringIntLength-6) ,3)]))),
    mid(concat([CurrencyFieldString,"0000"]),CurrencyFieldStringIntLength+1,3)])
    CurrencyFieldStringIntLength
    search(".", CurrencyFieldString) -1
    CurrencyFieldString
    right(concat([CurrencyField]), len(concat([CurrencyField]))-4)
    ```
2. Replace CurrencyField with the name of your specific currency field.
3. Copy this code into Spiff one piece at a time.
4. Add other formatting such as currency symbols to the top level.