Currency Format from Salesforce in Panda?
We're passing a number of fields directly from a Salesforce Opportunity into a Panda document, and everything seems to work fine except the formatting of currency fields. When a currency amount ends with something like 250.50, the last zero gets truncated in Panda, and looks terrible. Ideally, we'd like to show a comma in the thousands place as well. Is there any way to get these dollar amounts to actually look like dollar amounts?
-
Official comment
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 -
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.
Please sign in to leave a comment.
Comments
2 comments