[SalesForce] How to format a currency or decimal value without rounding

We have a strange requirement where in we have to display a "Currency" field without decimals and without rounding off..i.e., we have to ignore decimals (eventhough decimal part is greater than .5)
How to display a Currency field by ignoring its decimals ?

Scenario:

Field1–> 12.36 –> It should be displayed as 12 (Only for display purpose actual value should be 12.36)
Field2–> 13.86–> It should be displayed as 13 (It will display rounded off value .i.e., 14 in this case. But our requirement is it shouldn't round-off and ignore decimal part. It has to display as '13' in this case. It's actual value should be 13.86)

How do we do this ?

Best Answer

Edited for standard detail solution instead of Visualforce:

  1. Create a formula field of type currency.
  2. The formula should be Floor(YourfieldGoesHere)
  3. Add the formula to the page layout(s)

Of course this means you'll essentially have two fields for the value on the same detail page layout (the formula won't show when editing records), but you can move the actual value so it's out of the way.

Another option is to create a custom UI or chatter action or something to populate the actual value and then you could display only the formula on the detail page.