Format currency in a uitable in app designer

4 ビュー (過去 30 日間)
Rodney Smith
Rodney Smith 2025 年 5 月 1 日
コメント済み: Rodney Smith 2025 年 5 月 1 日
I have a table with a column that has dollar amounts with $ sign and commas. I have created the values as strings:
"$ 1,111,111"; "$ 2,222" so that the commas will line up. When I send this to a table in app designer it strips out the leading spaces between the dollar sign and the number:
$ 1,111,111
$ 2,222
What I want is
$ 1,111,111
$ 2,222
Any suggestions?

採用された回答

Walter Roberson
Walter Roberson 2025 年 5 月 1 日
編集済み: Walter Roberson 2025 年 5 月 1 日
You need to specify the uitable FontName property, supplying a fixed-width font.
Your current problem is that spaces in proportion-width fonts are very thin compared to other characters.
Note: there is no way to specify a font name on a per-column basis, only the entire uitable at a time
  3 件のコメント
Walter Roberson
Walter Roberson 2025 年 5 月 1 日
This is a problem in R2024b.
This problem is solved in R2025a Pre-release.
Rodney Smith
Rodney Smith 2025 年 5 月 1 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by