Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Floating point numbers with Direct Access connection

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Check Delphi Seattle IOS app without MAC ? 1 105
FMX StringGrid1->Canvas->FillRect Problem 3 170
URL for downloading Google Chrome for Win XP 2 182
Working with hours 3 65
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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