question

HCRUZ avatar image
HCRUZ asked

float to decimal

I need to update a Database. The database tables uses float. Must be changed to decimal(18,6). I can change the Column definitions and SP parameters, but, underlining application (C# and/or VB.NET) will still have parameters defined as SqlDbType.Float. I tried and it worked without changing the application. Is it reliable? Does the float accuracy problem gets resolved?
updatedecimal
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

HCRUZ avatar image
HCRUZ answered
Tkx for the reply, There is an aditional problem: the conversion decimal <-> float (double) is not implicit and errors may occur. The app will have to be updated. No way around it. So the question no longer makes sense.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
The data is only going to be as accurate as the input. If you were getting rounding errors with the float data, that still may remain from the input.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.