aditya shukla

aditya shukla

  • NA
  • 85
  • 42.1k

Related to Decimal number

Jan 14 2015 5:43 AM
How to allow numbers to 2 decimal in MVC4?

Answers (2)

0
Pradeep Shet

Pradeep Shet

  • 322
  • 5.3k
  • 4.4m
Jan 16 2015 3:33 AM
This will not change in MVC4, it is a concept of C# language. So according to me 

string d = "2.4444".ToString("f2");

string.Format("{0:0.00}", "2.4444");


Hope this helps you. Mark it as answered
0
Vulpes

Vulpes

  • 0
  • 96k
  • 2.6m
Jan 14 2015 6:50 PM
I don't know whether it's different in MVC4 to any other type of .NET application but, if 'd' is  any number, the following C# expression will express it as a string to 2 decimal places:

   d.ToString("F2")