Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rounding Floatingpoint-Numbers

Posted on 1999-07-28
4
Medium Priority
?
229 Views
Last Modified: 2010-04-04
Hi all

Is there any function in delphi (3) to round a variable of type double or extended with a specified precision? I mean a function that round for example 2.54651 to 2.5465

regards
rene
0
Comment
Question by:rene100
[X]
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
  • 2
4 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 1391596
use this

TNumericField.DisplayFormat

Rob
0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 1391597
I use
  Edit1.Text:=Format('%.4f',[2.54651]);
yields:
  2.5465
0
 
LVL 2

Author Comment

by:rene100
ID: 1391598
CalvinDay, your solution does excatly what i want...please post it as an answer.

thanx
rene
0
 
LVL 2

Accepted Solution

by:
CalvinDay earned 200 total points
ID: 1391599
I use
  Edit1.Text:=Format('%.4f',[2.54651]);
yields:
  2.5465
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

688 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