Solved

Floating point numbers with Direct Access connection

Posted on 1999-01-05
4
127 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now