How to convert Eval("Price") to 2 decimal places

Hi All,

I am using C# and have the following within a repeater control:

<%# Eval("Price") %>

The underlying data type is MONEY and the value is currently returning 10.0000. How can I format this like 10.00?

Many thanks,

Rit
LVL 1
rito1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ViceroyFizzlebottomConnect With a Mentor Commented:
Eval("Price", "{0:c}");
0
 
guru_samiConnect With a Mentor Commented:
You can also use String.Format function:

<%# String.Format("{0:C}",Eval("Price"))%>
0
 
rito1Author Commented:
Excellent, thanks both.

Rit
0
 
Muhammad Ousama GhazaliSolution Analyst & ArchitectCommented:
For more information on Formatting Types especially the numeric ones see this link and browse for Standard or Cutsom formats.
0
All Courses

From novice to tech pro — start learning today.