Solved

Floating point numbers with Direct Access connection

Posted on 1999-01-05
4
137 Views
Last Modified: 2013-11-23
Most floating point numbers look weird in SQL Explorer.
If I have 2.1 in Access table, it becames something like 2.099999999187487325. I use Delphi 4.02/Access 97.
0
Comment
Question by:eugenem
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1354728
This is because floating point values are only represented approximately by the floating point numeric types. 2.099999999187487325 will be the closest approximation to 2.1 that the particular field in the table you are viewing can manage. If displayed to 1 decimal place you would get 2.1.

This is a fundamental problem with floating point number representation and manipulation in software development and you need to be aware of this to avoid certain problems and pitfalls.

Cheers,

Raymond.
0
 
LVL 3

Author Comment

by:eugenem
ID: 1354729
So what could I do in this case?
0
 
LVL 3

Author Comment

by:eugenem
ID: 1354730
I was needed to change Precision property of corresponding TField to some small value.
Question is closed.
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1354731
I believe my answer stands. It did contain the reference to displaying to one decimal place...

Raymond.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 157
Intraweb download file link ? 1 132
How to open a new windows chrome resized and disabled the toolbar? 3 113
delphi parse string to params 3 122
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question