Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Multiply an Integer by a Percentage (arg!)

Posted on 2004-10-29
Medium Priority
300 Views
Hello,

I know this should be simple, but it's kicking my butt!
Here is what I got...

editbox1 contains a string representing a dollar amount
example = [58]

editbox6 contains a value representing a discount off of the price in editbox1
example = Discount [20] %

How do I calculate this and represent it in another string?

Thanks!
0
Question by:TherosEquipment
[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

LVL 1

Accepted Solution

vacerose earned 150 total points
ID: 12447989
FloatToStr(StrToFloat(editbox1.text) * StrToFloat(editbox6.text) / 100)
0

LVL 13

Expert Comment

ID: 12448402
var
percentage:real;
begin

percentage:=StrToFloat(editbox6.text) / 100;

0

Author Comment

ID: 12448422
I had to modify what you did, but you pointed me in the right direction...

listitem.subitems.Add(FloatToStr(StrToFloat(flatedit4.text) * (1 - (StrToFloat(flatedit6.text) / 100))));
0

## Featured Post

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
###### Suggested Courses
Course of the Month9 days, 3 hours left to enroll