This is a migrated thread and some comments may be shown as answers.

CellValueFormat - Number Formats

4 Answers 165 Views
SpreadProcessing
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 2
Mark asked on 19 Jan 2017, 02:30 PM

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   ));

4 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 2
answered on 19 Jan 2017, 02:56 PM

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)))
0
Accepted
Tanya
Telerik team
answered on 20 Jan 2017, 02:45 PM
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

0
Stephen
Top achievements
Rank 2
answered on 20 Sep 2017, 08:57 PM

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.

0
Tanya
Telerik team
answered on 25 Sep 2017, 10:15 AM
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

Tags
SpreadProcessing
Asked by
Mark
Top achievements
Rank 2
Answers by
Mark
Top achievements
Rank 2
Tanya
Telerik team
Stephen
Top achievements
Rank 2
Share this question
or