HyperMath

SetNumberFormat

SetNumberFormat

Previous topic Next topic No expanding text in this topic  

SetNumberFormat

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Sets the display format of numerical values.

Syntax

SetNumberFormat(str)

Arguments

str

A string specifying the desired format.  The options "short", "long", "scientific", or "default" are listed below:

 

 

"short"

The default.  Displays a maximum of five significant digits and uses scientific form if the exponent is larger.

 

 

"long"

Displays a maximum of 15 significant digits and uses scientific form if the exponent is larger.

 

 

"scientific"

Always displays in scientific notation with five digits after the decimal.

 

 

"default"

Restores the default format (short).

Example

Syntax

 

SetNumberFormat("short")

print(PI)

SetNumberFormat("long")

print(PI)

SetNumberFormat("scientific")

print(PI)

SetNumberFormat("default")

print(PI)

 

Result

 

3.1416

3.14159265358979

3.14159e+000

3.1416

Comments

Non-default settings are effective only for the current session.  A new session will revert to the default format.

See Also

GetNumberFormat