CellValueFormat - Number Formats

5 posts, 1 answers
  1. Mark
    Mark avatar
    2 posts
    Member since:
    Jul 2012

    Posted 19 Jan 2017 Link to this post

    I currently need to format some columns to use the "Accounting format". In your documentation, you talk about the document model exposing number formats. However none of your examples show how to access the document model (def, they show how to create custom number formats. Can you please tell me how I can access the Accounting format?

    worksheet.Cells[2, 5].SetFormat(new CellValueFormat(  SomeEnum/Class.AccountingFormat   ));
  2. Mark
    Mark avatar
    2 posts
    Member since:
    Jul 2012

    Posted 19 Jan 2017 in reply to Mark Link to this post

    Found the answer after poking around a bit more. Hopefully this helps someone else out.There is a class AccountingFormatStringBuilder.

    worksheet.Columns[2, 5].SetFormat(new CellValueFormat(AccountingFormatStringBuilder.BuildFormatString(CurrencyInfo.Symbol, 2)))
  3. Answer
    Tanya
    Admin
    Tanya avatar
    718 posts

    Posted 20 Jan 2017 Link to this post

    Hi Mark,

    Thank you for bringing this to our attention.

    Indeed, the AccountingFormatStringBuilder class is not included in the documentation. I logged a task to add information about it and updated your Telerik points as a token of appreciation for your cooperation.

    Regards,
    Tanya
    Telerik by Progress

  4. Stephen
    Stephen avatar
    90 posts
    Member since:
    Jan 2011

    Posted 20 Sep 2017 Link to this post

    Thank you, Mark!

    How did stumble upon that wizardry?  Just by scouring the API docs?

    The number formatting docs have not been updated yet to describe how to use the pre-defined types.  They don't even really describe the custom formats fully, but I'm assuming we can use the same specifiers as .NET.

  5. Tanya
    Admin
    Tanya avatar
    718 posts

    Posted 25 Sep 2017 Link to this post

    Hello Stephen,

    Indeed, we haven't still managed to update the documentation about format strings. The AccountingFormatStringBuilder class and its members are listed in the API Reference and we would much appreciate it if you share what would you expect to find in our documentation so we can ensure it will be described when we update the information.  

    Regards,
    Tanya
    Progress Telerik

Back to Top