tags:

views:

23

answers:

1

I'm trying to format a data bound value as below, but I keep getting a space as the thousands separator, i.e. the displayed text is always "12 340.00" when it should be "12,340.00".

What am I missing?

<asp:TextBox ID="budgetText" runat="server" Text='<%# Bind("Budget", "{0:#,0.00}") %>'></asp:TextBox>
+1  A: 

Try specifying the culture:

<asp:TextBox 
    ID="budgetText" 
    runat="server" 
    Text='<%# string.Format(CultureInfo.InvariantCulture, "{0:#,0.00}", Bind("Budget")) %>' />

or set the UI culture globally.

Darin Dimitrov