Format number with a thousands separator of your choice
A function to convert a number to a more readable format by adding thousands separators.
This very simple function lets you choose the thousands separator character and the number of decimal spaces to return. Any character (including white space) is accepted as a separator. For example
separatethousands( 1234.567, ',' , 1 )
returns string
'1,234.6'
Cite As
Eero Kuusi (2024). Format number with a thousands separator of your choice (https://www.mathworks.com/matlabcentral/fileexchange/28208-format-number-with-a-thousands-separator-of-your-choice), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.