This is a migrated thread and some comments may be shown as answers.

Format Sum

1 Answer 151 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
brigus
Top achievements
Rank 2
brigus asked on 30 Oct 2012, 02:29 PM
I have a textbox in the report footer that is summing a decimal field.  How can I get that field to show only two decimal places?  The below does not format at all.

Total Regulated Miles: {Format( "{{0:N2}}", CStr(Sum(Fields.MILES)))}

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 02 Nov 2012, 07:56 AM
Hi Brian,

CStr(Sum(Fields.MILES)) converts the value to a string, but with the specified format the Format functions expects decimal number. So the following expression should do what you expect:
{Format("{{0:N2}}", Sum(Fields.MILES))}

Regards,
Elian
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
brigus
Top achievements
Rank 2
Answers by
Elian
Telerik team
Share this question
or