Jaffer Sadiq

Jaffer Sadiq

  • NA
  • 155
  • 69.2k

How to display decimal value(money) format in mvc.

Oct 31 2018 8:42 AM
Hi,
 
I need to display decimal with seperated commas. please some one suggest. I can mange with string and int. But bit confusing in decimal
 
eg : 2348 = 2,2348.00 
 
 CS file : 
public decimal TotalAmount{get;set;}
 
Controller.cs :
 
decimal Tamount;
 
TAmount = Convert.ToDecimal(TotalAmount);
TotalAmount= Convert.ToDecimal(TAmount).ToString("#,##0.000")  // its throwing error and accept only for string
TotalAmount = ??????? What it should be?? 
 
It would be higly appreciated. if someone helps
 
 
 
 

Answers (3)