function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
confidexbillconfidexbill 

TEXT Formula result formatted with a comma for the thousands separator

I have the following formula used to convert a value to EURO:

"EUR " & IF(  NOT(CONTAINS(TEXT(CurrencyIsoCode), "EUR")),  TEXT(Amount*CASE(TEXT(CurrencyIsoCode), "USD", 0.677354 , "CHF", 0.9, 1)),TEXT(Amount))

 

I would like the returned result to be formatted with a comma for the thousands separator.

For example: 25,000

 

Changing the return type of the formula as currency does not work. I get the following error message:

Error: Invalid Data.

Formula result is data type (Text), incompatible with expected data type (Currency).

 

Any ideas?

wchristnywchristny

The error suggests your formula is returning a text value when Salesforce expects it to be a currency value.  Which is it supposed to be?

 

If it's supposed to return a currency, I would try using the VALUE() function to cast the result from text to currency (not sure if it would work since I've never tried casting to a currency type).

 

If the formula is supposed to return text, then I think you need to go back to the first step in defining the formula and specify that the return value of the formula will be "Text" instead of "Currency".