My application is in asp.Net MVC3 coded in C#.Net.
I want to truncate the decimal part of my values when they are displayed in the TextBoxes. The DataType for these values are set to Decimal in the database so even if i save 150 it saves as 150.0000.And when it displays a particular record it comes back as 150.0000 but i dont want it that way,i only want 150.
I have tried
@Html.TextBoxFor(string.Format("Decimal Truncation Format", model => model.myValue))
But not working..The values are travelling from many views. So can i have such a truncation in the model itself so that it applied to that value all the time.
If not possible that way then how can i achieve it.?