From f640487e27a3904831ff85033a2869e981e9d942 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 5 Mar 2014 19:11:25 -0800 Subject: Switch to 64-bit ints --- perfratio | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'perfratio') diff --git a/perfratio b/perfratio index 6ff3a12..fa0a912 100644 --- a/perfratio +++ b/perfratio @@ -1,31 +1,26 @@ #!/bin/sh awk ' -/^ 1/ && READY == 0 { printf (" 1 "); +/^ 1/ && READY == 0 { printf (" 1 "); for (i = 2; i < NF; i++) - printf (" %2d ", i); - printf (" Operation\n"); + printf (" %2d ", i); + printf (" Operation\n"); next; } -/^---/ { printf ("--------"); +/^---/ { printf ("------------"); for (i = 2; i < NF; i++) - printf (" ------"); + printf (" ----------"); printf (" ---------\n"); READY=1; next; } READY==1 { base=$1; - printf ("%8.1f", base); + printf ("%12.1f", base); for (i = 2; i < '$1'; i++) { if (base == 0) printf (" lots ", $i); else { rate=$i/base; - if (rate < .1) - printf (" %6.3f", rate); - else if (rate < 1000) - printf (" %6.2f", rate); - else - printf (" %6.0f", rate); + printf (" %10.3f", rate); } } printf (" "); -- cgit v1.2.3