Hi, I got a decimal member in my viewmodel and get populated from the database (say 55.5, or 100.00) In my view I use TextBoxFor<> for this member. Is there any way to have a number (it's actually a percentage) like 100.00 display as 100 instead, and 55.50 as 55.5? Probably a stupid question (really tired here)
Wouldn't casting it to a double deal with the issue? double.Parse(YourDecimal).ToString() Code (markup):