Solved

FORMULA PROBLEM VERY EASY POINTS!

Posted on 1998-01-12
3
215 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

Suggested Solutions

Title # Comments Views Activity
creating threads in delphi 1 191
How to convert memory stream to PDF file 6 216
Problem working with dynamic array - help 2 45
Firemonkey Listview item popup menu ? 1 71
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…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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