long - string conversion 
Author Message
 long - string conversion

Hi,
    I am converting a long data type number to a string then back to a long.
When I display the string it rounds up or down, not giving the decimal
places that may have been in the original long number. Can anyone tell my
why this happens and how to overcome conversion without loss of the decimal
places.
    Thanx a million anyone that can sort me out.

Al



Wed, 26 Sep 2001 03:00:00 GMT  
 long - string conversion

Quote:

>Hi,
>    I am converting a long data type number to a string then back to a long.
>When I display the string it rounds up or down, not giving the decimal
>places that may have been in the original long number. Can anyone tell my
>why this happens and how to overcome conversion without loss of the decimal
>places.
>    Thanx a million anyone that can sort me out.

Long is short for Long Integer, and don't have any decimal places.  The
original long numbers couldn't have had any decimal portions to lose.  Sounds
like you should be using Single or Double data type instead.

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Wed, 26 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Conversion from string value to long integer.

2. String data conversion from byte array to a string

3. C Strings to VB Strings Conversion?

4. converting a string to a long (string contains a Hex number)

5. How to convert extra long strings into their equivalent Hex Strings in VBA (Word 2K)

6. Conversion of lat/long to WGS84 grid coords or similar

7. Data Type Conversion Error with Long Binary Field -PLEASE HELP

8. HELP WITH LONG/SHORT FILE NAME CONVERSION

9. ArcIMS Lat/long to Lambert Conversion using VB?

10. Conversion from long to RGB

11. Long File Name conversion

12. YYYYMMDD string date conversion

 

 
Powered by phpBB® Forum Software