Need Help for Round the Value

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hi Every Body,
I have tow columns in the database, the third
columns the division of both columns. The first two columns are both of type
decimal,
when the third columns get value its type is also decimal,
for example
first col value 34.00
second col value 34.00
third col value 34.00/34.00 = 1.000000000
Now when i am trying to bind that value with asp.net datagrid, I am try to
round it using Math.Round() function to precision of 2
for example
Math.Round(DataBinder.Eval(Container.DataItem,"third
Col"),2)
At this point it generate error and all fields which are binded after that
field are not bind properly

Regards

Muhammad Jamil Nawaz
 
G

Guest

Hi,

What is the error message you are getting....?

Make sure that you don't have a zero (0) in your second column. Otherwise
you may get a "divisible by zero" error.

Anyway post your error message, sot hat we can discuss further.

Cheers,

Jerome. M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top