Hello,
I am trying to pull data from a database which are integer values,
and dive them and return a decimal or a percent really.
My code seems to round the number up or down.
for example if I have a Colmuncount of 3 and a sum of 8
the return value is 3 when it should be 2.6.
how do a format my code to display the value in decimal places.
any help is appreciated.
------------------------------------------------------------------------------------------
Dim RatingSum As Integer = Ds.Tables(0).Ro ws(0)("RatingSu m").ToString ()
Dim columncount As Integer = Ds.Tables(1).Ro ws(0)("columnco unt").ToString( )
Dim Rating As Integer = RatingSum / columncount
Return Rating
--------------------------------------------------------------------------------------------------
I am trying to pull data from a database which are integer values,
and dive them and return a decimal or a percent really.
My code seems to round the number up or down.
for example if I have a Colmuncount of 3 and a sum of 8
the return value is 3 when it should be 2.6.
how do a format my code to display the value in decimal places.
any help is appreciated.
------------------------------------------------------------------------------------------
Dim RatingSum As Integer = Ds.Tables(0).Ro ws(0)("RatingSu m").ToString ()
Dim columncount As Integer = Ds.Tables(1).Ro ws(0)("columnco unt").ToString( )
Dim Rating As Integer = RatingSum / columncount
Return Rating
--------------------------------------------------------------------------------------------------
Comment