wpf - Format text in flow document table cell -


I have a program that creates a table, connects it with table tables in a flow document, which Are populated with. Everything works great with one exception. A column of cells in the table displays the costs and they have been prepared as follows:

  cellValue = "$" + string.Format ("{0: ##, # 00}", purse (cell value), pad left (22 - cell value lang);   

It suggests that these formatting numbers like $ 11,111 take a different width such as $ 10,000 . I would think because the font does not have the same width for each letter.

What I would like to do, is the cost such as when formatted as an accounting in Excel spreadsheet (eg dollar sign is left hand appropriate, numbers are correct and appropriate and numbers range from cell to cell Are).

Example:

$ 10,000.00
$ 11,111.11

If anyone knows that application to reach this goal To format, please let me know.

This is probably very easy but on an estimate I will use a fixed font for cell "courier new "So that all the characters are the same width and they align. The downside is that "Courier New" is not the most beautiful font to use.

I'm sure Excel uses a much more sophisticated mechanism to align numerical values.

Perhaps you should use an object that mimics a spreadsheet better than a table in a flood document.

Comments