473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Need Help for Round the Value

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,"thi rd
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
Nov 19 '05 #1
1 2503
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

"msnews.microsoft.com" wrote:
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,"thi rd
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: leegold2 | last post by:
Hi, I have been looking around for a way to paginate php/mysql table output. There are a lot of hits when I google it. But unfortunately what I have tried either does not work or is imho just...
1
by: roll | last post by:
Hi! I have to get the difference between date 1 and date 2 (that is date 2 minus date 1) ; the format is timestamp. How can I do it? Does anybody have an example of code? Thank you.. Pero
9
by: Ronald W. Roberts | last post by:
I'm having a problem understanding the Round function. Below are quotes from two books on VB.NET. The first book shows examples with one argument and how it rounds. The second book something...
4
by: Fuzzydave | last post by:
I have been using a round command in a few places to round a value to zero decimal places using the following format, round('+value+', 0) but this consistantly returns the rounded result of...
2
by: Tsair | last post by:
I found the decimal round up problem, System.Math.Round(106.865, 2)= 106.86 System.Math.Round(106.875, 2) = 106.88 System.Math.Round(106.885, 2) = 106.88 System.Math.Round(106.895, 2) = 106.9...
4
by: Jassim Rahma | last post by:
I have a number, for example 0.152 or 1.729 and I want to allow to round to the first 0.010 or 0.050 or 0.100
9
by: Verizon News Server | last post by:
Hi, I am a newbie with Javascript. I am trying to build a simple form that calculates the cost of gasoline for a trip. It simply divides the trip distance by the mpg and multiplies that by the...
3
by: Yonih | last post by:
Hey Everyone, I was hoping someone could help me here. I need a way to have a drop down that when selected it can keep a value and display it below here is an example. A drop down list of...
4
by: Yonih | last post by:
So I am trying to get this Calculator to work. It needs to take in a vaule, and select a shipping Everythin works great except the shipping part. I need it to take the shipping value and add it to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.