• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

format eval data

Hi.

In my repeater, i have this;: <%# Eval("[\"Price\"]")%>

How can I format the price?

normally I do it like this from codebehind:
rs["TotalPris"].ToString("#,##0.00")
0
Jesper Christensen
Asked:
Jesper Christensen
  • 3
  • 2
1 Solution
 
HainKurtSr. System AnalystCommented:
try:

<%# Eval("Price").ToString("#,##0.00")%>
0
 
Kaushal AroraTechnical AnalystCommented:
Its the same as you do in code behind. Eval tag means server side functionality.
0
 
Jesper ChristensenAuthor Commented:
I get this error:

CS1501: no overload for the method 'ToString'
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
HainKurtSr. System AnalystCommented:
try:

<%# DataBinder.Eval(Container.DataItem, "Price", "{0:#,##0.00}") %>
0
 
HainKurtSr. System AnalystCommented:
or this

<%# DataBinder.Eval(Container.DataItem, "Price", "#,##0.00") %>
 
0
 
Jesper ChristensenAuthor Commented:
This one did the magic HainKurt: <%# DataBinder.Eval(Container.DataItem, "Price", "{0:#,##0.00}") %>
Thank you very much !!
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now