I have actually a necessity to display screen a an adverse value through a disagreement symbol and text functions but whenever ns tried doing the am acquiring unexpected result.

For eg:

dollar(10000-30000,0) = "($20,000)" $20,000" one extra "(,)" is getting included due to an adverse symbol.

text(10000-30000,"0") = "2000-0" 20000" an extra "-" is getting included due to an adverse symbol.

Do I must pass anything particular format in the over functions to gain the wanted output?

Can someone you re welcome tell me what should be the style I must use for the over scenario?

Regards,

Balaji.R




You are watching: Negative before or after dollar sign

discussion posts and also replies room publicly visible


*

+1Krishna Chaitanya
A Score Level 1
end 3 year ago

Hi , use listed below code 1)

stripwith(if( sign( 10000-30000 ) append( "-", dollar( 10000-30000 ) ), dollar( 10000-30000 ) ), "()" )

result : "-$20,000.00"

2)dollar(abs(10000-30000)) result : "$20,000.00"

3)

text( 10000-30000, "###,###;-###,###")

result : "-20,000"


*

0aloks0004
A Score Level 2


See more: How Much Is Rickey Henderson Worth, 5 Most Valuable Baseball Cards 1980S

end 3 years ago

Hi rpbalaji2006 (balajir0001) there are multiple methods to achieve this requirement, thus please find the code snippet to achieve your requirement, mentioned below:

/* because that dollar() related need *//* using Regex sample - utilizing lennythewonderdog.net constant Expression functions plugin */regexreplaceall( "<()>", dollar(10000 - 30000, 0), "")/* OUTPUT: "$20,000" *//* achieving the very same using wire Manipulation - without plugin */load( local!amount: dollar(10000 - 30000, 0), if( isnull(local!amount), dollar(0), replace( replace(local!amount, 1, 1, ""), len(replace(local!amount, 1, 1, "")), 1, "" ) ))/* OUTPUT: "$20,000" *//* for text() need *//* as you are already aware, when you subtract more amount from lesser one, you need to expect negative value as it's result */Approach 1: 10000-30000 /* OUTPUT: -20000 Type: Number (Integer) */Approach 2: tostring(10000-30000) /* OUTPUT: "-20000" Type: message *//* you don't must use text duty to achieve this requirement, you have the right to simply use one of the over approach relying on what return form you room expecting */