=Format(Fields!fieldvalue.Value, 0) - shows negative like -123.23 i want it like (123.23)

vbnetcoder
vbnetcoder used Ask the Experts™
on
This code

=Format(Fields!fieldvalue.Value, 0)

shows negative formatted like -123.23 i want it like (123.23)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
you may try ABS function, like:

=Format(ABS(Fields!fieldvalue.Value), 0) 

Open in new window

Author

Commented:
I tried that and it didn't show the negative as negative at all.

I need it to display like this (233.23)
Ryan ChongSoftware Team Lead

Commented:
ok, what about this?
=IIF( Fields!fieldvalue.Value < 0 , "(" & Format(ABS(Fields!fieldvalue.Value), 0)  & ")" , Format(Fields!fieldvalue.Value, 0)  )

Open in new window

Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

try


Format(Fields!fieldvalue.Value, "#,#0.00";(#,#0.00))

Author

Commented:
That gives me an error
]
"character is not valid"
My bad.  

Format(Fields!fieldvalue.Value, "#,#0.00;(#,#0.00)")

Author

Commented:
ty

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial