- format as strings
- independently round() each column to the appropriate number of digits
Formatting Numbers in App Designer's UITable
23 views (last 30 days)
Show older comments
Felipe Dicker
on 10 Jan 2025
Commented: Felipe Dicker
on 10 Jan 2025
Is there a way to format numbers in a UITable in App Designer? For example, can I have the second row's format be '%.1f' and cell (4,2)'s format be '%.4e'? I don't want to use strings because I need to keep the table's numerical data.
0 Comments
Accepted Answer
Walter Roberson
on 10 Jan 2025
You have two possibilities here:
The problem with strings is that a) the table no longer contains full-precision data; and b) you lose the ability to force edits to be strictly numeric format (though with CellEditCallback you can post-process and remove the unacceptable portions of the entry.)
The problem with round() is that a) the table no longer contains full-precision data; and b) trailing zero decimal places will not be displayed, so you cannot force the equivalent of %.4f
There is no mechanism that preserves the full-precision values inside the uitable but displays the data with custom format. You can set 'ColumnFormat' for individual entries to be 'short' but that is not so satisfactory.
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!