On Mon, Aug 24, 2009 at 3:07 PM, Joel Reymont<[email protected]> wrote:
> Any suggestions on how I can figure out the right # of leading 0s?
>
> I really wish dtrace had floating-point printing.
>
This should do what you want:
printa("%...@09d\n", @int);
i.e., print it in a field 9 characters wide with leading 0's. For example:
x2200# dtrace -qn 'beg...@int = sum(28538);printa("0...@09d\n", @int);exit(0)}'
0.000028538
x2200#
_______________________________________________
dtrace-discuss mailing list
[email protected]