all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

How to have negative numbers with () rather than preceded by -


How to have negative numbers with () rather than preceded by - Stefan Wrobel
8/5/2005 11:23:05 AM
sql server reporting services:
I'm trying to format negatives to be surrounded in Paren () rather than
preceded by - (accounting style). I know that if I pick currency it will do
this, but I want to format numbers to be just integers, not preceded by a -
sign, and have commas. Here is my current format string: "0,0" , which
formats numbers as follows:

3535 as 3,535
-3535 as -3,535

I would like it to format as follows:
3535 as 3,535
-3535 as (3,535)

RE: How to have negative numbers with () rather than preceded by - Stefan Wrobel
8/5/2005 11:33:19 AM
Actually answered this one myself (I believe)

"0,0;(0,0)"

Basically the semicolon separates the different cases, so if there was a
special case for when it was 0, then the format would be "0,0;(0,0);Nothing"
(for the reference of anyone else who might be trying to do this.

Please correct me if I'm wrong, but this appears to work!

[quoted text, click to view]
RE: How to have negative numbers with () rather than preceded by - Parimal
8/8/2005 12:06:02 AM
Hi,
We are using foll. code to format for having parenthesis for -ve values
depending upon the Currency code and data from DB. In amount cell we are
using the code.


=iif(First(Fields!CurrencyCode.Value = "JPY",
"VendorDetails"),FORMATNUMBER(Fields!RoyaltyAmount.Value,0,true,true,true)
,iif(First(Fields!CurrencyCode.Value = "USD",
"VendorDetails"),FORMATNUMBER(Fields!RoyaltyAmount.Value,2,true,true,true),FORMATNUMBER(Fields!RoyaltyAmount.Value,2,true,true,true)))

It works fine but when we export the report in the Excel the cells get
converted in the string and also theaccounting format is lost.
Need help.Thanx.
Parimal.



[quoted text, click to view]
AddThis Social Bookmark Button