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)

Float

  • Last UpdatedOct 04, 2024
  • 1 minute read

Convert a string to a number.

Syntax

Float(x)

Arguments

  • x

    A string or a number, or an attribute whose value evaluates to a number at time of evaluation

Returns

A number for a numeric string. If x is already a number, x is returned

Exceptions

If x is not a number or a numeric string, returns Calc Failed

Notes

Unit of measure of the argument, if it exists, is carried over to the result. Float also takes timespan and boolean as argument. Note, however, that Float only converts timespan format to the number of seconds from 12:00am Jan 1, 1970.

Example

  • Float("12.3")

    [Converts string to a number and returns 12.3]

  • Float(12.3)

    [Returns 12.3]

  • Float('*')

    [Return the total number of seconds passed since Jan 1, 1970]

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