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

Avg of int

2 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
andrea
Top achievements
Rank 1
andrea asked on 19 Apr 2011, 04:13 PM
Hi,
I have a table with avg summaries. When the type column is int32, the avg value is int,  the last two decimal places are always .00.
I try to set the format {0:#0.00} but the avg value is still int.
There is a way to get a float or double value for avg function with an int32 column?

thank you very much.

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 22 Apr 2011, 10:12 AM
Hi Andrea,

Similar to Transact-SQL, when the argument of the function is an integer, the returned type is an integer. If you need the exact (floating point) result, you should cast the argument to floating point using the built-in CDbl() function.

Regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
andrea
Top achievements
Rank 1
answered on 22 Apr 2011, 12:40 PM
Ok, it work,
thank you Steve!
Tags
General Discussions
Asked by
andrea
Top achievements
Rank 1
Answers by
Steve
Telerik team
andrea
Top achievements
Rank 1
Share this question
or