View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Insert commas into numbers

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.16 KB File ID: #41520 Version: 1.1

Insert commas into numbers



29 Apr 2013 (Updated )

Insert commas into numbers.

| Watch this File

File Information

Insert commas into numbers, e.g. 1234567 -> '1,234,567'.

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
04 Jun 2013 Jan Simon

Jan Simon (view profile)

A faster loop-free approach wich considers a fractional part also:
S = sprintf('%.16g', pi * 1e12);
S(2, strfind(S, '.') - 4:-3:1) = ',';
S = transpose(S(S ~= char(0)));

Comment only
03 Jun 2013 1.1

Fixed leading commas

Contact us