I am working with C# and Linq and what I intend is to show a series of data that I add to a list with the currency format.
Data in SQL Server (RealEjecutado <-- is what i want to convert)
100000.00
I want it to be displayed like this:
$100,000.00
My code
List<Dashboard> list = new List<Dashboard>();
using (Web_INCAEntities dc = new Web_INCAEntities())
{
var v = (from a in dc.TBL_PBI
select new Dashboard
{
id = a.id,
RealEjecutado = a.RealEjecutado,
PlanVigente = a.PlanVigente,
Reprogramacion = a.Reprogramacion
});
list = v.ToList();
}
return View("../Dashboard/PontoHorizonte/Graficas", list);
Markup:
@grid.GetHtml(
tableStyle: "fl-table",
htmlAttributes: new { id = "tablaadmin" },
columns: grid.Columns(
grid.Column(header: "Real Ejecutado", format: @<text><div class="" data-id="@item.id" data-propertyname="RealEjecutado" id="" ><p id="userinput">@item.RealEjecutado</p></div></text>),
grid.Column(header: "Plan Vigente", format:@<text><div class="" data-id="@item.id" data-propertyname="PlanVigente">@item.PlanVigente</div></text>),
grid.Column(header: "Proyección INCA", format:@<text><div class="" data-id="@item.id" data-propertyname="Reprogramacion">@item.Reprogramacion</div></text>)
)
)
I have not found on the web something that works for me, that is why I ask your help to solve this, thanks in advance