Sunday, February 19, 2012

Format a float number

Hi
I am new to reporting servcies. I am wondering about the syntax I can use
to format a field in the report. The field is summing up a float column, and
I want only two decimals after the comma to be displayed.
This is the Value: =Sum(Fields!Samtals.Value)
What can I put in the format propertie for this field so a number like
123,4325345 becomes 123,42?Textboxes have a FormatCode property which allows you to specify a .NET
formatcode. For you particular example you would use N2 which gives you 2
decimals.
More details on formatcodes can be found on MSDN:
*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp
*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ágúst Valgarð" <gstValgar@.discussions.microsoft.com> wrote in message
news:FCCBD2DE-858A-41E0-924D-282854ED6BC7@.microsoft.com...
> Hi
> I am new to reporting servcies. I am wondering about the syntax I can use
> to format a field in the report. The field is summing up a float column,
and
> I want only two decimals after the comma to be displayed.
> This is the Value: =Sum(Fields!Samtals.Value)
> What can I put in the format propertie for this field so a number like
> 123,4325345 becomes 123,42?
>

No comments:

Post a Comment