I really cannot figure out how to format double/decimal value like that
12,123,123.78
Here is my html
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column(format: (item) => Html.ActionLink("Candy Bar", "Products", new { id = item.ChainID })),
grid.Column(format: (item) => Html.ActionLink("Per Capita", "ProductsByCategory", new { id = item.ChainID })),
grid.Column("CinemaName", "Complejo"),
grid.Column("TotalSum2", "Monto").Format( ???? )
)
If I do this
grid.Column("TotalSum2", "Monto", format: (item) => item.TotalSum2.ToString("0:C"))
I get this:
270223:C
and this
"{0:n0}"
gives
{27022:n3}
SOLUTION:
grid.Column("TotalSum2", "Monto", format: (item) => item.TotalSum2.ToString("#,0.00"))
Have a look at CultureInfo and format strings.