Ryan Moore said:
how do I format a databound field in a datagrid to place a comma for a
currency (eg 126,000)
I'm currently using:
DataBinder.Eval(Container.DataItem, "price", "{0:c}"
Ryan,
Try setting the CurrentCulture and CurrentUICulture for the current thread
in the Application_BeginRequest event handler.
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Initialize the CurrentCulture and CurrentUICulture with the
' Browser's user language setting.
Try
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
Catch
' Culture not supported. Use US English.
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
End Try
' Set the CurrentUICulture to be the same as CurrentCulture
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
End Sub
--
Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com