Bad number format specifier using DataFormatString="{0:c}" 2025v2 399

Posted by: enrique.pv-ext on 9 January 2026, 6:43 am EST

  • Posted 9 January 2026, 6:43 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1GridView from C1.Web.Wijmo.Controls.48.dll

    My markup code:

    <cc2:C1BoundField  DataField="TOTAL_AMOUNT"  SortExpression="TOTAL_AMOUNT" DataFormatString="{0:c}">
                        <ItemStyle HorizontalAlign="Right" Width="100px" CssClass="GridNumber" />

    It works with 2010v1 version.

    Now, 2025v2 399 version, I get the error Bad number format specifier

    Uncaught Bad number format specifier: {
    u @ WijmoControlsResource.axd?

    If I delete DataFormatString=“{0:c}” , it works

    Any suggestions for use DataFormatString=“{0:c}” ?

    thanks a lot

  • Posted 13 January 2026, 1:30 am EST

    Hi,

    You can use DataFormatString=“c0” to achieve the desired behavior. Here is the code snippet for the same:

     <wijmo:C1BoundField DataField="TOTAL_AMOUNT"
     HeaderText="Amount"
     SortExpression="TOTAL_AMOUNT"
     DataFormatString="c">

    Kindly refer to the attached sample for full implementation. WebApplication1.zip

    Thanks & regards,

    Aastha

  • Posted 15 January 2026, 7:43 am EST - Updated 15 January 2026, 8:15 am EST

    Thx Aastha, please, confirm if you welcome

    DataFormatString="c0"

    OR

    DataFormatString="c"

    c0 vs c ?

    https://developer.mescius.com/componentone/docs/webforms/online-gridview/C1.Web.Wijmo.Controls.45~C1.Web.Wijmo.Controls.C1GridView.C1BoundField~DataFormatString.html

    DataFormatString Property (C1BoundField)

    Gets or sets the string that specifies the display format for items in the column.

    Note: Formatting of values is done on the client-side using globalize.min.js library. Use formatting patterns supported by that library, for more information on the library please check https://github.com/jquery/globalize

    Examples:

    “n” - displays numeric values in number format.

    “d” - displays numeric values in decimal format.

    “d” - displays date values in short date format.///

    “p” - displays numeric values in percentage format.

    “c” - displays numeric values in currency format.

    regards

  • Posted 16 January 2026, 1:15 am EST

    Hi,

    The string “c” is the default .NET format specifier for currency formatting. By default, it formats the value with up to two decimal places. However, by specifying a number after “c”, such as “c0” or “c1”, you can customize the number of decimal places as per your requirement.

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels