Formats |
Category: | Numeric |
Alignment: | right |
Syntax | |
Syntax Description | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
Dw.p |
specifies the width of the output field. This argument is optional.
Default: | 12 |
Range: | 1-32 |
specifies the precision. This argument is optional.
Default: | 3 |
Range: | 0-9 |
Requirement: | p must be less than w |
Tip: | If p is omitted or is specified as 0, then p is set to 3. |
Tip: | If zero is the desired precision, use the w.d format in place of the Dw.p format. |
Details |
The Dw.p format writes numbers so that the decimal point aligns in groups of values with similar magnitude. Larger values of p print the data values with more precision and potentially more shifts in the decimal point alignment. Smaller values of p print the data values with less precision and a greater chance of decimal point alignment.
Comparisons |
The BESTw. format writes as many significant digits as possible in the output field, but if the numbers vary in magnitude, the decimal points do not line up.
Dw.p writes numbers with the desired precision and more alignment than the BESTw format.
The BESTDw.p format is a combination of the BESTw. format and the Dw.p format in that it formats all numeric data, and it does a better job of aligning decimals than the BESTw. format.
The w.d format aligns decimal points, if possible, but it does not necessarily show the same precision for all numbers.
Examples |
put @1 x d10.4;
Value of x | Results |
---|---|
|
----+----1----+----2 |
12345 |
12345.0 |
1234.5 |
1234.5 |
123.45 |
123.45000 |
12.345 |
12.34500 |
1.2345 |
1.23450 |
.12345 |
0.12345 |
See Also |
Format:
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.