xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/ofmta.awk (revision 3ee4fc2aa6b5136515cc3eed32d3c6ef33e37471)
1*3ee4fc2aSCody Peter Mello# Date: Thu, 14 Apr 2011 08:18:55 -0500
2*3ee4fc2aSCody Peter Mello# From: j.eh@mchsi.com
3*3ee4fc2aSCody Peter Mello# To: arnold@skeeve.com
4*3ee4fc2aSCody Peter Mello# Subject: CONVFMT test for the test suite
5*3ee4fc2aSCody Peter Mello# Message-ID: <20110414131855.GA1801@apollo>
6*3ee4fc2aSCody Peter Mello#
7*3ee4fc2aSCody Peter Mello# Hi,
8*3ee4fc2aSCody Peter Mello#
9*3ee4fc2aSCody Peter Mello# Please consider adding this to the test suite. 3.1.8 segfaults
10*3ee4fc2aSCody Peter Mello# with this.
11*3ee4fc2aSCody Peter Mello#
12*3ee4fc2aSCody Peter Mello# Thanks,
13*3ee4fc2aSCody Peter Mello#
14*3ee4fc2aSCody Peter Mello# John
15*3ee4fc2aSCody Peter Mello#
16*3ee4fc2aSCody Peter Mello#
17*3ee4fc2aSCody Peter MelloBEGIN {
18*3ee4fc2aSCody Peter Mello	i=1.2345
19*3ee4fc2aSCody Peter Mello	i=3+i
20*3ee4fc2aSCody Peter Mello	a[i]="hi"
21*3ee4fc2aSCody Peter Mello	OFMT="%.1f"
22*3ee4fc2aSCody Peter Mello	print i
23*3ee4fc2aSCody Peter Mello	for (x in a) print x, a[x]
24*3ee4fc2aSCody Peter Mello	print a[i]
25*3ee4fc2aSCody Peter Mello	print "--------"
26*3ee4fc2aSCody Peter Mello	CONVFMT=OFMT="%.3f"
27*3ee4fc2aSCody Peter Mello	print i
28*3ee4fc2aSCody Peter Mello	for (x in a) print x, a[x]
29*3ee4fc2aSCody Peter Mello	print a[i]
30*3ee4fc2aSCody Peter Mello}
31