8: TSP command reference Model 2450 Interactive SourceMeter® Instrument
8-62 2450-901-01 Rev. B/September 2013
format.asciiprecision
This attribute sets the precision (number of digits) for all numbers returned in the ASCII format.
Type TSP-Link accessible Affected by Where saved Default value
Attribute (RW) No
Restore configuration
Instrument reset
Configuration script 0 (Automatic)
Usage
precision = format.asciiprecision
format.asciiprecision = precision
A number representing the number of digits to be printed for numbers printed with
the print(), printbuffer(), and printnumber() functions; must be a
number between 1 and 16; set to 0 to have the instrument select the precision
automatically
Details
This attribute specifies the precision (number of digits) for numeric data printed with the print(),
printbuffer(), and printnumber() functions. The format.asciiprecision attribute is only used with
the ASCII format. The precision value must be a number between 1 and 16.
Note that the precision is the number of significant digits printed. There is always one digit to the left of the
decimal point; be sure to include this digit when setting the precision.
Example
format.asciiprecision = 10
x = 2.54
printnumber(x)
format.asciiprecision = 3
2.540000000e+00
2.54e+00
Also see
format.byteorder (on page 8-63)
format.data (on page 8-64)
print() (on page 8-77)
printbuffer() (on page 8-78)
printnumber() (on page 8-81)