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
Danielle Rosen 8Danielle Rosen 8 

Currency to text formula field

Hi there, I'm seeing some solutions to my question, but they're not exactly what I'm looking for. I am trying to convert the entry on a currency field to a text formula field. The below formula gets me the closest to what I need, but it seems to eliminate decimal places. i.e. $1.00 changes to $1. Is it possible to retain the decimals without rounding? Thanks in advance!

"$"&
 TEXT( UnitPrice )
Maharajan CMaharajan C
Hi Danielle,

Please try the below formula:
 
IF(UnitPrice > 0, "$", "-$") & 
IF(ABS(UnitPrice) >= 1000000, TEXT(FLOOR(ABS(UnitPrice) / 1000000)) & ",", "") & 
IF(ABS(UnitPrice) >= 1000, RIGHT(TEXT(FLOOR(ABS(UnitPrice) / 1000)), 3) & ",", "") & 
RIGHT(TEXT(FLOOR(ABS(UnitPrice))), 3) & "." & 
IF(MOD(ABS(UnitPrice) , 1) * 100 < 10, "0" & TEXT(ROUND(MOD(ABS(UnitPrice) , 1), 2) * 100), TEXT(MIN(ROUND(MOD(ABS(UnitPrice) , 1), 2) * 100, 99)))

https://developer.salesforce.com/forums/?id=906F00000008utHIAQ

Thanks,
Maharajan.C
Danielle Rosen 8Danielle Rosen 8
Hi there - Thanks for this, but it doesn't quite accomplish what I need. Some of our pricing has 3-4 decimal places, and this formula truncates at 2. Also it would appear to display prices that are $0.00 as -$0.00.