473,379 Members | 1,253 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,379 software developers and data experts.

DataGridView and Floating point numbers

Hi

I have a DataGridView in C# which is bound to a datasource, which is an array of a user defined class. Some of the members of this class are floating point numbers. All the column in the datagrid are populated nicely when the form is loaded.

But when I edit any column (in the datagridview) that is associated with a float data type with a value of 0, I get an Exception - "Input String was not in the correct format". Any idea, why? If I type any non-zero floating point numbers, I do not get any exception and all is well.

I appreciate if someone could help me identify why I get the exception when I enter 0 onto a datagridview column with underlying type to be floating point number. What is the best way to handle this exception?

Thanks in advance for any suggestion

Kelly
Aug 5 '10 #1
0 1492

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Benedikt Wismans | last post by:
dear group! <script language="javascript"> var a = 60381.11; var b = 1437261.58; var c = a + b; alert (c); -> 1497642.6900000002 var a = 60381.11; var b = 1437261.50;
4
by: Tommi Mäkitalo | last post by:
Hi I need to format floating-point-numbers with exact 2 digits after decimal point. I could use printf with "%.2f", but it don't use std::locale. Any ideas? -- Tommi Mäkitalo
3
by: Mantorok Redgormor | last post by:
What have some of you guys read to have a solid understanding of how floating-point numbers are represented or handled by the processor and what the difference between single and double precision...
4
by: aprivate | last post by:
Hi I have a newbie question. I have a value which is of type SINGLE DIM s as single s=3.7
10
by: 63q2o4i02 | last post by:
Hi, I'm using python to run some lab equipment using PyVisa. When I read a list of values from the equipment, one of the fields is 32 bits of flags, but the value is returned as a floating...
18
by: woessner | last post by:
Does anyone know of a fast way to multiply floating point numbers by powers of two? Conceptually, all you need to do is add to the mantissa. But can I write C code (or x86 assembly) to accomplish...
14
by: Robert Latest | last post by:
Hi guys, I'm sure this has been beaten to death on this newsgroup, but I can't find it in the CLC FAQ. Consider the following code: -------- double x = some_value_from_somewhere;
5
by: Mike Schilling | last post by:
I want to write some C# that converts between floating-point numbers and strings in a non-locale-specific way. That is, I want decimal points always to be ".", etc. The simple overloads of...
14
by: nw | last post by:
Hi, I'd like to compare 2 floating point numbers within a given error. I'd rather not use a absolute error but one related to the number of values that can be represented between the two floats....
23
by: ultimatewarrior | last post by:
Hi all, first of all I beg your pardon if this question has been asked before, but I was unable to find anything in the past posts. I have written a piece of code that was supposed to be quite...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.