1

I am attempting to display dollar amounts with an icon next to them in order to indicate if they are over/below a certain dollar amount.

So far the closest I can come to accomplishing this is a formula such as :

IF(currencyfield__c < currencyfield2__c,

Text(currencyfield__c) & IMAGE('/servlet/servlet.FileDownload?file=015550000000fff, Name) , 

Text(currencyfield__c))

But unfortunately since this will display the currencyfield__c as text no commas will appear in the currency to properly display thousands.

And apparently I can't solve this by making the formula field a currency field because then it won't properly display the image.

Any ideas ?

3
  • Can't you have two fields, one for the image and other for the number, for this? I'm not sure you can have both at the same time. May 26, 2016 at 13:53
  • Unfortunately it can't be two fields. I need to be able to display the dollar amount and icon in one field so I can include it in reports and views. If I try to display it as two separate fields it's very confusing because they don't appear next to one another very well.
    – Zoom_v
    May 26, 2016 at 14:12
  • I just realized I was using the word "columns" when I meant to say "commas". I'm sorry for the confusion. The currency fields don't display properly when using the TEXT() function because there are no commas.
    – Zoom_v
    May 26, 2016 at 15:42

1 Answer 1

4
IMAGE("/servlet/servlet.FileDownload?file=01536000001fC4X", "US") + " US - Price: " +  TEXT(Value__c)

This gives me this result in my test organization:

screenshot

So you can do what you asked in your question, but if you work with more than one currency, then you will need to have an IF next to the IMAGE tag to set the proper currency prefix.

Note: My locale is set to Brazil, and that's why it is displaying R$ as the currency, instead of $.

4
  • Using TEXT(field__c) will not properly display commas for the currency field value. Maybe I'm missing something in your example ?
    – Zoom_v
    May 26, 2016 at 15:36
  • No, you are right. The text function converts the value to a plain decimal, just adding the dot to sign the decimal cases. You actually might need to create a text field, and populate it with the formatted number. This can be achieved with a trigger on the object, that recalculates this when the record is inserted or updated. Sorry, I didn't notice it earlier because I used a small number. May 26, 2016 at 16:33
  • 1
    @Zoom_v This is possible with a more complex formula, check it out here
    – o-lexi
    May 26, 2016 at 17:50
  • Then you've got it! You will need a trigger only if the formula gets too big to get compiled. :) May 26, 2016 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .