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 2018)

Int

  • Last UpdatedJan 11, 2023
  • 1 minute read

Return the integer part of an integer or real number.

Syntax

Int(x)

Arguments

  • x

    Number, Boolean, numeric string, timespan, or an attribute whose value evaluates to a number at time of evaluation

Returns

If x is a number, the integer part of x is returned. If x is a string, it is first converted into a number. If x is a timespan, the number of seconds from 12:00am January 1, 1970 is returned

Exceptions

Returns error if the variable is not assigned

Notes

Int('*') returns UTC time in seconds from 12:00am January 1, 1970

Example

  • Int('att1')

    [Return the integer part of the value of 'att1' at current time]

  • Int('*'-'t')

    [Return how many seconds have passed since the start of day today]

  • Int(2.1)

    [Returns 2]

  • Int("2.1")

    [First converts the string to a number and returns 2]

  • Int(true)

    [Returns 1]

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