|
Packit |
575503 |
BEGIN {
|
|
Packit |
575503 |
split(" 1.234 ", f, "|") # create a numeric string (strnum) value
|
|
Packit |
575503 |
OFMT = "%.1f"
|
|
Packit |
575503 |
CONVFMT = "%.2f"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
# Check whether a strnum is displayed the same way before and
|
|
Packit |
575503 |
# after force_number is called. Also, should numeric strings
|
|
Packit |
575503 |
# be formatted with OFMT and CONVFMT or show the original string value?
|
|
Packit |
575503 |
|
|
Packit |
575503 |
print f[1] # OFMT
|
|
Packit |
575503 |
print (f[1] "") # CONVFMT
|
|
Packit |
575503 |
|
|
Packit |
575503 |
# force conversion to NUMBER if it has not happened already
|
|
Packit |
575503 |
x = f[1]+0
|
|
Packit |
575503 |
|
|
Packit |
575503 |
print f[1] # OFMT
|
|
Packit |
575503 |
print (f[1] "") # CONVFMT
|
|
Packit |
575503 |
}
|