Currency Format from Salesforce in Panda?

Comments

2 comments

  • Official comment
    Avatar
    mike turke

    Hi Doug, I'm Mike, a Solutions Architect at PandaDoc. You can create a formula field for your Opportunity that will reflect the amount in your currency field and will keep the formatting with commas and two decimal values, including if it ends in a 0.

    To do this you will need to go into Salesforce Setup and create a new field on your Opportunity. It will need to be a formula field and text type. You can use the following formula:

    IF(opp_currency_field_test__c >= 1000000,

    TEXT(FLOOR(opp_currency_field_test__c / 1000000))+ & ",",

    "")&

    IF(opp_currency_field_test__c >= 1000,

    RIGHT(TEXT(FLOOR(opp_currency_field_test__c / 1000)), 3)& ",",

    "") & RIGHT(TEXT(FLOOR(opp_currency_field_test__c)), 3)& "." &

    IF(MOD(opp_currency_field_test__c , 1) * 100 < 10,

    "0" & TEXT(ROUND(MOD(opp_currency_field_test__c , 1), 2) * 100), "$" +

    TEXT(MIN(ROUND(MOD(opp_currency_field_test__c , 1), 2) * 100, 99))

    )

     

    Just replace "opp_currency_field_test__c" with the Salesforce API name of your currency field.

    Here's what the variables will look like:

     

    Comment actions Permalink
  • Avatar
    Doug Ricks

    Thanks Mike... Sounds like that may be our only path.  It's a bit painful as we have probably a dozen different "fee" fields like this and have already sprinkled them across numerous documents, which work OK except the formatting.  If we really need them to look like the currency amounts they are, we'll have to create "duplicates" of every field with these formulas and then replace every occurrence throughout our templates.  

    0
    Comment actions Permalink

Please sign in to leave a comment.