hi guys, I have a field in datatable .If 1000 is the value in it, i want to display it as 1000.00.Then if user changes to 1000.50 it should display as it is.Is there anyway to do this?Can anybody help?
+3
A:
Sample Code:
Dim bigNumber As Decimal = 1234567.123456
Console.WriteLine("F2: " & bigNumber.ToString("F2"))
Console.WriteLine("N2: " & bigNumber.ToString("N2"))
Output:
F2: 1234567.12
N2: 1,234,567.12
Ramesh Soni
2009-08-20 05:39:34
+1
A:
There is a good chance that you want to display currency, so do this:
1000m.ToString("C"); // Will show $1000.00, $1000,00 etc depending on culture
// OR just
1000m.ToString("N2"); 1000m.ToString("F2"); // For plain numbers: 1000.00, 1000,00
Dmytrii Nagirniak
2009-08-20 05:41:31
A:
can be accomplish like..
decimal ab = 50;
ab.ToString("####0.00");
Muhammad Akhtar
2009-08-20 06:14:39