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

Report function rounds number

1 Answer 152 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Gois
Top achievements
Rank 1
Michael Gois asked on 13 Dec 2009, 09:19 PM
Hi

I have a textbox on my report, and I have set the Value of it to ""=Fields.break_mins / 10". I have also set the format of the textbox to {0:N2}. It performs the calculation as it should, but the number is always rounded. E.g. if break_mins is 104, then the result is printed as 10.00 rather than 10.40. I have tried changing the number format to {0:D2} as well but the result is still the same. Is there a way to get it to perform the division without rounding the number?

Thanks in advance
Michael

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Dec 2009, 04:20 PM
Hello Michael Gois,

The division of two integers is also an int and therefore only the part before the delimiter is taken into account. Your expression should work with float values in order to return float values e.g.:

=Fields.break_mins / 10.0


Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Michael Gois
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or