P
Pieter
Hi,
I'm having some troubles with my numeric-types in my VB.NET 2005
application, together with a SQL Server 2000.
- I first used Single in my application, and Decimal in my database. But a
Single with value 4.475 was converted to a Decimal with value
4.4749999999999996D. So after inserting and selecting it from the database I
got another value than the original!
- So I used also the Decimal in my application, but now all my numbers are
formatted with all the decimals: when my value is "1", it shows "1.0000". A
single value roudns it nicely to 1, but the decimal value shows the whole
decimal part, even when it isn't needed.
What I need is: the users should only see the decimal part when needed, AND
my values have to be the same (no 4.475 to 4.474999999999 changements).
This seems such a simple and basic need, but I just keep having troubles
with it :-(
What should I do/use? Another numeric datatype in my application? Another
datatype in my Database??
Any help/hints/links/information would be really appreciated!
Thansk a lot in advance,
Pieter
I'm having some troubles with my numeric-types in my VB.NET 2005
application, together with a SQL Server 2000.
- I first used Single in my application, and Decimal in my database. But a
Single with value 4.475 was converted to a Decimal with value
4.4749999999999996D. So after inserting and selecting it from the database I
got another value than the original!
- So I used also the Decimal in my application, but now all my numbers are
formatted with all the decimals: when my value is "1", it shows "1.0000". A
single value roudns it nicely to 1, but the decimal value shows the whole
decimal part, even when it isn't needed.
What I need is: the users should only see the decimal part when needed, AND
my values have to be the same (no 4.475 to 4.474999999999 changements).
This seems such a simple and basic need, but I just keep having troubles
with it :-(
What should I do/use? Another numeric datatype in my application? Another
datatype in my Database??
Any help/hints/links/information would be really appreciated!
Thansk a lot in advance,
Pieter