- 论坛徽章:
- 0
|
回复 1# kr_zhang
man awk好像已经说明比较清楚了,LZ可以看看:
Variable Typing And Conversion
Variables and fields may be (floating point) numbers, or strings, or both. How the value of a variable is
interpreted depends upon its context. If used in a numeric expression, it will be treated as a number, if used
as a string it will be treated as a string.
To force a variable to be treated as a number, add 0 to it; to force it to be treated as a string, concatenate
it with the null string.
When a string must be converted to a number, the conversion is accomplished using strtod(3). A number is con-
verted to a string by using the value of CONVFMT as a format string for sprintf(3), with the numeric value of
the variable as the argument. |
|