Format currency in a uitable in app designer

조회 수: 5 (최근 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 CenterFile Exchange에서 Develop 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