rpkhare
asked on
Retrieving two decimal places
I want to retrieve value upto decimal places. How to modify this line:
GrossTotal = Convert.ToDecimal(txtGross Amount.Tex t);
I want that GrossTotal has value like this:
123.45
2455.78
GrossTotal = Convert.ToDecimal(txtGross
I want that GrossTotal has value like this:
123.45
2455.78
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I use the ToString version personally. Sometimes when using Math.Round and adding it to the .Text property of a control, it will not add your trailing zeros.
If you use GrossTotal for calculating then using Math.Round.
If you use GrossTotal for printing then using imateyelectronics' version.
See http://msdn.microsoft.com/en-us/library/364x0z75(VS.80).aspx for more information on Decimal.
If you use GrossTotal for printing then using imateyelectronics' version.
See http://msdn.microsoft.com/en-us/library/364x0z75(VS.80).aspx for more information on Decimal.
ASKER