How to format a number as percentage without the percentage sign?

Define a custom culture with its own NumberFormatInfo which returns String.Empty for its PercentSymbol property.

Then use that custom culture for impacted pages (or for the whole application). This could be done by cloning from the default so other regional settings are preserved.


Why don't you just multiply the number by 100 and use your "{0:N0}" format string? That seems to me to be the easiest solution.

Unless you can come up with a viable reason why that's out of the question, that's my advice. It's not rocket science :-)


but multiplying by 100 is exactly what you want!

protected void myGrdiView_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        myObjectType ot = (myObjectType)e.Row.DataItem;

        ot.myNumber = ot.myNumber * 100; // multiply by 100
    }
}

and in the HTML

<asp:BoundField DataType="myNumber" HeaderText="%" StringFormat="{0:N0}" />