Project in ASP.Net and C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sajitk
    New Member
    • Feb 2008
    • 77

    Project in ASP.Net and C#

    Dear Friends,

    I have to retrieve a value from the database into a webform.

    For eg. in the table Salary, I have a field called Tot_Salary. If the value in this field is 20000.

    When i retireve this into a form, i want it to be displayed as 20,000.00.

    If again the Tot_Salary has some value like 28524.15

    then this will be displayed as 28,524.15

    Can this be done....???

    Thanks in advance

    Sajit
  • balame2004
    New Member
    • Mar 2008
    • 142

    #2
    Try this :

    double salary = 1243.56;
    string formatted_Salar y=String.Format ("{0:#,##0.00;( #,##0.00);Nothi ng}", salary);

    Comment

    Working...