Frac
- Last UpdatedOct 04, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
Return the fractional part of a real number. Returns 0 for integers.
Syntax
Frac(x)
Arguments
-
x
Must be an integer or real number
Returns
The fractional part of x
Exceptions
If x is not an integer or real number, returns an error value
Notes
By definition:
Unit of measure of the argument, if it exists, is carried over to the result
Example
-
Frac(1)
[Returns 0]
-
Frac(1.3)
[Returns 0.3]
-
Frac(TagVal('att1', '*'))
[Return the fractional part of the value of 'att1' at current time.]