aboutsummaryrefslogtreecommitdiffstats
path: root/test/convfmt.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:35:31 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:35:31 +0300
commit8ceb5f934787eb7be5fb452fb39179df66119954 (patch)
tree56a80fc5c118f7c2ebad7ab44bd8be048b2f7ec2 /test/convfmt.awk
parent2f83a4e72166e811a9f0b4726c19a3d5a0b17dcb (diff)
downloadegawk-8ceb5f934787eb7be5fb452fb39179df66119954.tar.gz
egawk-8ceb5f934787eb7be5fb452fb39179df66119954.tar.bz2
egawk-8ceb5f934787eb7be5fb452fb39179df66119954.zip
Move to gawk-2.15.6.
Diffstat (limited to 'test/convfmt.awk')
-rw-r--r--test/convfmt.awk10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/convfmt.awk b/test/convfmt.awk
new file mode 100644
index 00000000..90fd204b
--- /dev/null
+++ b/test/convfmt.awk
@@ -0,0 +1,10 @@
+BEGIN {
+ CONVFMT = "%2.2f"
+ a = 123.456
+ b = a "" # give `a' string value also
+ printf "a = %s\n", a
+ CONVFMT = "%.6g"
+ printf "a = %s\n", a
+ a += 0 # make `a' numeric only again
+ printf "a = %s\n", a # use `a' as string
+}