Solved

FORMULA PROBLEM VERY EASY POINTS!

Posted on 1998-01-12
3
218 Views
Last Modified: 2010-04-04
I have a edit box that calculates the total for the items in a grid.  It works properly but when you add an item that ends in a zero such as $9.90, $9.00, $5.50 etc, it only shows the total as $24.4 instead of $24.40 can anyone tell me why that occurs?  I think this is fairly easy but I am offer 25pts.

Thanks,
Tony
0
Comment
Question by:aj85
[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
3 Comments
 
LVL 5

Accepted Solution

by:
julio011597 earned 50 total points
ID: 1356269
Isn't $9.90 nine dollars and 90 cents?

In the end of the procedure that computes the total, you should have something like:

TotalEdit.Text := '$' + Total;

Try something like this instead:

TotalEdit.Text := Format('$%.2f', [Total]);

HTH, julio
0
 

Author Comment

by:aj85
ID: 1356270
Worked like a charm! I am increasing your points by 25.

Thanks,
Tony
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1356271
Thank you.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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