NLBESTw. Format

Writes the best numerical notation based on the locale.
Category: Numeric
Alignment: right

Syntax

NLBESTw.

Syntax Description

w
specifies the width of the output field.
Default:12
Range:1–32
Tip:If you print numbers between 0 and .01 exclusively, then use a field width of at least 7 to avoid excessive rounding. If you print numbers between 0 and -.01 exclusively, then use a field width of at least 8.

Details

The NLBEST format writes the best numerical value based on the locale's decimal point and the sign mark's location. NLBEST is similar to the BEST format. For more information, see the BEST format in the SAS Formats and Informats: Reference.

Example

The following code produces results based on the locale:
x=-1257000
 put x nlbest6.;
 put x nlbest3.;
 put "=====";
x=-0.1
 put x nlbest6.;
 put x nlbest3.;
 put "=====";
x=0.1
 put x nlbest6.;
 put x nlbest3.;
 put "=====";
x=1257000
 put x nlbest6.;
 put x nlbest3.;
Locales
Results
locale=English_UnitedStates
-126E4
***
=====
-0.1
-.1
=====
0.1
0.1
=====
1.26E6
1E6
locale=German_Germany
-126E4
***
=====
-0,1
-,1
=====
0,1
0,1
=====
1,26E6
1E6
locale=ar_BH
126E4-
***
=====
0.1-
.1-
=====
0.1
0.1
=====
1.26E6
1E6