<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Is there a function to do this?</span><div style="font-family:arial,sans-serif;font-size:13px">If not and I/someone writes it, is there interest to add it to std.datetime?<br>
<div><br></div><div>Duration t = ...;<br></div><div><a href="http://t.to/" target="_blank">t.to</a>!string => 5 secs, 889 ms, and 811 ìs</div><div><a href="http://t.round.to/" target="_blank">t.round.to</a>!string => 5 secs</div>
<div><br></div><div>t=...;</div><div><div><a href="http://t.to/" target="_blank">t.to</a>!string => 889 ms, and 811 ìs</div><div><a href="http://t.round.to/" target="_blank">t.round.to</a>!string => 889 secs</div>
</div><div><br></div><div>Use case: shorter logs.</div><div><br></div><div>Similarly, it would be nice to have a module in phobos for representing other units such as bytes, and have a similar rounding scheme as in unix command 'ls -lh' which shows 532K, 12M etc)</div>
</div></div>