Friday, March 9, 2012

Format text box with parentheses if negative

The users want to see negative values like this:

(-$1,000)

How do I format negative values that way without some major iif statement?

Hello,

I don't think you can unless you use an IIf statement.

=IIf(Fields!Amount.Value < 0, "(" & Fields!Amount.Value & ")", Fields!Amount.Value)

Hope this helps.

Jarret

|||

Haven't tested this formula I think it is similar to what Excel uses.

$#,##0_);(-$#,##0)

or

x,xx0.00_;(x,xx0.00(_)

cheers,

Andrew

|||

I have tested this one though...

#0.00;(#0.00)

cheers,

Andrew

|||

Try to use

FormatNumber(field!Num.Value, 0, 0, -1, 0)

This might work for you.

-Rohit

|||

Well, I've learned my something new for today. I'm guessing when you use a semicolon, the left side is the format for positive numbers and the right is for negative numbers? Thanks Andrew!

This one worked for me.

$#,##0.##;(-$#,##0.##)

Jarret

No comments:

Post a Comment