Solved

Calculate sum of currency textbox values II

Posted on 2006-06-25
2
717 Views
Last Modified: 2012-06-27
HI Experts,

I need help on the code to calculate the sum of textbox values.

Sample of amounts entered in TextBoxes:
TextBoxA = $7890.00
TextBoxB = $7860.00
TextBoxC = $10.00
TextBoxD = $0.00

TextBoxE = Total of amounts

All TextBox Null values are $0.00
Properties are set to Currency.

Windows Application
Visual Studio 2005
SQL Server 2005




0
Comment
Question by:dave_sky
[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 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 16979147
How about something like:

        Try
            Dim total As Double = 0.0
            total += Double.Parse(TextBox1.Text.Substring(1))
            total += Double.Parse(TextBox2.Text.Substring(1))
            total += Double.Parse(TextBox3.Text.Substring(1))
            total += Double.Parse(TextBox4.Text.Substring(1))
            TextBox6.Text = total.ToString("C")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
0
 

Author Comment

by:dave_sky
ID: 16979240
That was easy!

Many thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

617 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