I am trying to format the contents of a text box:
this.lblSearchResults1.Text =
Convert.ToDouble(lblSearchResults1.Text).ToString();
H
For complete custom control, use ... .ToString("#,##0.00")
or variations thereof. The .
and ,
will be replaced by culture dependent symbols. In most of europe you'd get 1.234,56.
Another useful picture is 0.0#
.
To use a pattern depending on the users (or on a selected) culture, use The Numeric ("N") Format Specifier, as in .ToString("N")
or "... {0:N}"
.