James Wilson
James Wilson

Reputation: 5150

Formatting Eval into a currency, forcing en-US

I have this line of code:

<%# Eval( "Balance", "{0:C}" )%>

How do I always force that to display currency in en-US regardless of what locale they have setup?

Upvotes: 1

Views: 4550

Answers (1)

epotter
epotter

Reputation: 7799

Try this:

<%# String.Format( new System.Globalization.CultureInfo("en-US"), "{0:C}", Eval("Balance") %>

You can also set the culture for the entire page or for the entire application as described here.

Upvotes: 6

Related Questions