The setdefaultfloatformat statement sets the default format for converting floating point values to text (unsupported).


This statement has one parameter:

template – IEEE template for converting floating point to text. This is usually in the format %.NNg, where NN is the number of digits to be displayed.


This statement changes the template used for converting floating point values to text. Please note that this statement is unsupported – we recommend using the default template. Specifying an invalid template will cause incorrect display of floating point numbers (or even no display at all).

This example tells Panorama to display 16 digits of precision (this was the default for Panorama X 10.1 and earlier, but is no longer recommended because IEEE floating point numbers don’t actually store 16 digits, and this may display numbers that appear to be inexact.)

setdefaultfloatformat "%.16g"

Since IEEE floating point values only contain about 15 1/2 digits, specifying display of 16 digits can result in unexpected output like this:

str(0.07) ☞ 0.07000000000000001

The extra digit in the 16th place is because IEEE floating point cannot accurately store the value 0.07. For detailed technical information about IEEE floating point numbers see double precision floating point.

If you specify an empty format, Panorama will reset to the default template (%.15g).

setdefaultfloatformat ""

Displaying only 15 digits eliminates possible inaccuracy in the display of the 16th digit.

str(0.07) ☞ 0.07

To find out the current format setting, use the info(“defaultfloatformat”) function.

See Also


10.2NewNew in this version.