SetDecimalPoints

Sets the number of decimal places to be displayed, for a specified range of real numbers. This setting will be used by all screen objects and animations that have the Auto Format option enabled, as well as by the AutoFormat function.

Function Group Execution Windows Embedded Thin Client
SetDecimalPoints Graphic Synchronous Supported Supported Supported

Syntax

SetDecimalPoints(numBaseValue,numDecimalPoints)
numBaseValue
The base value of the range of real numbers. For negative values, the range includes all real numbers less than or equal to that value. For positive values, the range includes all real numbers greater than or equal to that number. (You can set the other limit of the range by calling the function again with a new set of parameters.)
numDecimalPoints
The number of decimal places to be displayed, for the range of real numbers specified by numBaseValue.

Returned value

0 Error
1 Success

Notes

If you call this function more than once with different parameters for each call, then you can build a virtual table of format settings. You can set a different number of decimal places for each range of real numbers, and all of the settings are saved for the duration of runtime or until you reset the table using the ResetDecimalPointsTable function.

Note: This formatting does not change the actual value of any tag or expression. It only changes how the value is displayed by on-screen objects.

Examples

Tag Name Expression
Tag SetDecimalPoints( 1.5, 3 ) // Displays 3 decimal places for all real numbers greater than or equal to 1.5.
Tag SetDecimalPoints( −3, 1 ) // Displays 1 decimal place for all real numbers less than or equal to −3.