473,545 Members | 2,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting from long to double

After changing all the variables in a table from long to double.
you get 9.1====becomes= === 9.1999998092651 4
ok I checked microsoft and they had a workaround.
export the values to excel...then import them back into the new table.
well I tried that and get the same thing.
is there a work around for the work around LOL

Dec 4 '07 #1
3 2491
sparks wrote:
After changing all the variables in a table from long to double.
you get 9.1====becomes= === 9.1999998092651 4
ok I checked microsoft and they had a workaround.
export the values to excel...then import them back into the new table.
well I tried that and get the same thing.
is there a work around for the work around LOL
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

9.1 would not "fit" in a Long column. Longs are large Integers (no
decimals). So my guess is that you originally had a TEXT column w/
decimal numbers as the values.

One tedious way to change the text values to Double values would be to
create a new table that has the same columns as the original table,
except change the numbers Text column to a Double data type. Then
import all the rows from the original table into the new table using an
Append query - like this (say colC is the converting column):

INSERT INTO <new table name(colA, colB, colC)
SELECT colA, colB, Val(colC)
FROM <old table name>

Then delete the old table (or rename it for safety's sake) and name the
new table w/ the old table's name.

--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBR1XXnoechKq OuFEgEQL/XwCdE8LrW3ykVnb BMaYa8KigAmU4Me IAn1Q+
5lTUXLNy7Jerrki ISfMXeAHS
=qGRG
-----END PGP SIGNATURE-----
Dec 4 '07 #2
On Dec 4, 1:24 pm, sparks <jstal...@swbel l.netwrote:
After changing all the variables in a table from long to double.
you get 9.1====becomes= === 9.1999998092651 4
ok I checked microsoft and they had a workaround.
export the values to excel...then import them back into the new table.
well I tried that and get the same thing.
is there a work around for the work around LOL

try

http://www.braintransplants.com/

hth
Dec 5 '07 #3
Yes you are correct. I went and looked at each variable and there are
203 variables. 14 of which are single, fixed, 1 and 9 text fields..
its the single to double that has the problem that I was talking
about.9.1 becomes 9.0999998092651 4 when its changed from single to
double.

Sorry about that it was my mistake, I thought that all the variables
were longs and did not think about how you get that value in a long.
On Tue, 04 Dec 2007 18:24:26 GMT, sparks <js******@swbel l.netwrote:
>After changing all the variables in a table from long to double.
you get 9.1====becomes= === 9.1999998092651 4
ok I checked microsoft and they had a workaround.
export the values to excel...then import them back into the new table.
well I tried that and get the same thing.
is there a work around for the work around LOL
Dec 5 '07 #4

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

Similar topics

2
2662
by: Govind | last post by:
Hi All, I want to Convert 32 bit integers to byte in right alighed format . For 32 = the usual way is BitConverter.GetBytes(int32)==> xx xx 00 00 , but i want right aligned like 00 00 xx xx.Is there any way. Regards, Govind.
4
3299
by: Cyde Weys | last post by:
I'm currently working on converting a simulator program from Visual Basic 6.0 to Visual C++ .NET. I've figured out most of the stuff, but there's still one thing I haven't gotten to and I've never really had to deal with it before. I'm programming a front-end for what is a compiled Fortran program. The VB source does the following to call...
12
3135
by: Frederik Vanderhaeghe | last post by:
Hi, I have a problem converting text to a double. Why doesn't the code work: If Not (txtdocbedrag.Text = "") Then Select Case ddlBedrag.SelectedIndex Case 0 Case 1
116
35709
by: Dilip | last post by:
Recently in our code, I ran into a situation where were stuffing a float inside a double. The precision was extended automatically because of that. To make a long story short, this caused problems elsewhere in another part of the system where that figure was used for some calculation and some eventual truncation led to the system going...
10
1963
by: Ron | last post by:
I want to calculate the surface area of a sphere from an inputed radius with option strict on. I guess I am not converting something correctly. Here is what I am doing: I have a textbox txtradius that I enter a radius into. I then have a lable that I want the surface area to be displayed in called lblsurface
2
3991
by: CoreyWhite | last post by:
Problem: You have numbers in string format, but you need to convert them to a numeric type, such as an int or float. Solution: You can do this with the standard library functions. The functions strtol, strtod, and strtoul, defined in <cstdlib>, convert a null- terminated character string to a long int, double, or unsigned long. You can...
5
16127
jeffbroodwar
by: jeffbroodwar | last post by:
Hi everyone, I have a program that converts variables long,string,double to byte array here's the code : for long : //CompanyId temp = longToByteArray(CompanyId); for (i=0,i2=7; i<5; i++,i2--)
2
5086
by: clintonb | last post by:
Victor said: The double value that I'm trying to convert to GCSMoney (which is implemented as cents) was produced by multiplying a dollar amount by an interest rate to get interest. double amount = 126.60; double interestRate = .075; double interest = amount * interestRate;
7
4769
by: ma740988 | last post by:
Consider the equation (flight dynamics stuff): Yaw (Degrees) = Azimuth Angle(Radians) * 180 (Degrees) / 3.1415926535897932384626433832795 (Radians) There's a valid reason to use single precision floating point types. The number of decimal digits guaranteed to be correct on my implementation is 6. (i.e numeric_limits < float >::digits10 =...
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7757
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5329
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.