Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Format string

Posted on 2008-11-19
4
Medium Priority
?
525 Views
Last Modified: 2012-05-05
I have this code and i need format the field price for 2 decimal places:
<%#DataBinder.Eval(Container.DataItem, "price").ToString()%>
How can do it
0
Comment
Question by:rflorencio
4 Comments
 
LVL 15

Assisted Solution

by:David L. Hansen
David L. Hansen earned 600 total points
ID: 22997394
formatCurrency(myValue, 2)
0
 

Author Comment

by:rflorencio
ID: 22997449
the code works but the currency symbol ¬ appears in the right, it´s possible remove symbol.
0
 
LVL 12

Accepted Solution

by:
techExtreme earned 800 total points
ID: 22997470
Hi do this:
<%#DataBinder.Eval(Container.DataItem, "price","{0:n2}").ToString()%>
0
 
LVL 18

Assisted Solution

by:David Robitaille
David Robitaille earned 600 total points
ID: 22997486
you could put your format string
ToString(here)
for 2 decimal,
<%#DataBinder.Eval(Container.DataItem, "price").ToString("N02")%>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question