freebsd-skq/contrib/awk/test/convfmt.awk
1997-10-14 18:17:11 +00:00

11 lines
258 B
Awk

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
}