Method Reference: calendarDuration.dispstrings

calendarDuration: cstr = dispstrings (calD)

Get display formatted strings for each element of a calendarDuration array.

cstr = dispstrings (calD) returns a cellstr array of character vectors, cstr, which has the same size as the input calendarDuration array, calD. The returned text representations in cstr are formatted according to the 'Format' property of the input array calD.

Whole calendar units are rendered with up to six significant digits and the seconds component with five, each switching to exponent notation beyond that, so a million days reads '1e+06d'. Rounding applies to a component on its own and never carries into the one above it, which is why 59.9999 seconds read '60s' rather than a further minute.

Source Code: calendarDuration