I have a view model that show a product.. but the price is in decimal format and i dont want to format it in the view, it should be automaticly formatted using the viewmodel. I know there is a property displayformat.. is there anyone that know to to render the decimal in the view in the formatted form such 0.00$ ?
相关问题
- Entity Framework throws exception - Network Relate
- How do I create a multidimensional array of object
- Slow loading first page - ASP.NET MVC
- How to do an inline style with asp.net mvc 3 razor
- Save Image to file keeping aspect ratio in a WPF a
相关文章
- “Dynamic operations can only be performed in homog
- Change color of bars depending on value in Highcha
- How to get server path of physical path ?
- How to find the exceptions / errors when TryUpdate
- ASP.Net MVC 3: optgroup support in Html.DropDownLi
- A circular reference was detected while serializin
- AccessViolationException was unhandled
- Can the “dynamic” type vary safely in a generic co
you can use DisplayFormat attribute like following to show the formatted result
Then myVal(lets value is 123.222), will be displayed as 123.222$
More about formatting strings, http://msdn.microsoft.com/en-us/library/fzeeb5cd.aspx