Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2024 R2)

Frac

  • Last UpdatedOct 04, 2024
  • 1 minute read

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: Int(x) + Frac(x) = x

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.]

In This Topic
TitleResults for “How to create a CRG?”Also Available in