Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
I want to add 100,000 + 100,000 in two textbox, I get 200 please help me
Posted
Updated 14-Jan-14 22:40pm
v3
Comments
_Maxxx_ 14-Jan-14 23:53pm    
Best thing to do is to post the code you have so we can look at it and (hopefully) tell you where you are going wrong!
Presumably you convert the strings to numeric - that's probably where the fault lies - but without the code it's hard to help further.
Bernhard Hiller 15-Jan-14 2:38am    
Region Settings may cause a problem - the comma can be a Decimal Separator instead of Thousand Separator.

1 solution

  1. Parse the (operand) text boxes Text property to obtain Decimal values (see Decimal.Parse[^]).
  2. Add the two Decimal operands in order to obtain their (Decimal) sum
  3. Obtain a good-formatted string, calling sum.Format with the ppropriate arguments (see "Standard Numeric Format Strings"[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900