• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • 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 ChristensenProgrammerAuthor Commented:
I get this error:

CS1501: no overload for the method 'ToString'
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
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 ChristensenProgrammerAuthor Commented:
This one did the magic HainKurt: <%# DataBinder.Eval(Container.DataItem, "Price", "{0:#,##0.00}") %>
Thank you very much !!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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