Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbase III numeric data type length conversion

Status
Not open for further replies.

rhubi

Programmer
Aug 24, 2006
15
0
0
SG
Hi,

I have an application in vb.net which accepts 18 digit numeric data to sql server, then later on I'm going to output it in a dbase III format. I'm having a problem during the said conversion. For example, when a numeric data 123456789012345678 transformed into dbase format it does not get the exact value. It becomes 123456789012346000. Does the dbase III accept only upto 15 digits length? Is there any way how I can solve my problem in the conversion?

I really appreciate for any help that will come. Thank you very much.
 
Numbers are stored in tables as pre-defined character strings, which allows considerable flexibility within the decimal system.

But Dbase and some other xBase languages use floating point notation internally. Generally calculations are done with 18 digits precision but only 15 digits come back from the calculations. That's so when you add multiple numbers such as 1+1+1+1+1 you will get back 5 and not 5.000000000000001 or 4.999999999999999.

Anyway, you've encountered the 15-digit practical limitation. Can you store, retrieve and handle such large numbers as character strings? If you need to add, subtract, multiply, divide, etc. such large numbers you may have to write your own routines to handle the calculations.

 
Thank u mark... I actually thought about that.
But my problem was that the output of the conversion program will be used by another system which will only accept numeric numbers in dbase format. Thanks for the help mark..I've already got a solution to my problem.

 
If it will help anyone else who encounters a similar issue in the future, please post your solution (or work around).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top