Re: Another number fomatting question
- From: gazelle@xxxxxxxxxxxxxxxxxxxxx (Kenny McCormack)
- Date: Fri, 30 Nov 2007 19:45:38 +0000 (UTC)
In article <47505D8B.1060105@xxxxxxx>, Hermann Peifer <peifer@xxxxxxx> wrote:
Hello,
I was wondering if there is an easy way to align numbers with varying
precision at the decimal point.
Examples:
111.1111
2.222222
-33333.3
44444444
...which should look like:
111.1111
2.222222
-33333.3
44444444
(I don't want to add trailing 0's, but rather leave the numbers as they
are.)
Thanks in advance, Hermann
Here's a brute force approach (I put your list of numbers into a file,
fed as input to this [GAWK] script):
{split($1,T,".");printf("%10d%s\n",T[1],2 in T ? "."T[2] : "")}
Note that the "10" is a parameter...
.
- Follow-Ups:
- Re: Another number fomatting question
- From: Hermann Peifer
- Re: Another number fomatting question
- References:
- Another number fomatting question
- From: Hermann Peifer
- Another number fomatting question
- Prev by Date: Another number fomatting question
- Next by Date: assistance with awk or sed
- Previous by thread: Another number fomatting question
- Next by thread: Re: Another number fomatting question
- Index(es):