Number functions

Use the number functions to extract the mantissa from a decimal or floating point number. The Number category in the expression editor also contains the type casting functions, which you can use to cast numbers as double, float, or integer data types.

Square brackets indicate an argument is optional. The examples show the function as it appears in a Derivation field in the Transformer stage.

The type casting functions help you when you perform mathematical calculations using numeric fields. For example, if you have a calculation using an output column of type float derived from an input column of type integer in a Parallel Transformer stage the result is derived as an integer regardless of its float type. If you want a non-integral result for a calculation using integral operands, you can use the type casting functions to cast the integer operands into non-integral operands.

Note: The transformer functions AsDouble(), AsFloat(), and AsInteger() behave differently than other transformer data conversions functions when they are used in derivations where the result is a string. This is because the transformer compiler does not convert the function result for these functions to a string. For more information, see the following topic: Understanding the results of AsDouble(), AsFloat(), and AsInteger() transform functions.
AsDouble
Treat the given number as a double.
  • Input: number
  • Output: number (double)
  • Examples. In the following expression, the input column mynumber contains an integer, but the function outputs a double. If mylink.mynumber contains the value 56, then the following two functions are equivalent, and return the value 1.29629629629629619E+01:
    AsDouble(56/4.32)
    AsDouble(mylink.mynumber/4.32)
    
AsFloat
Treat the given number as a float.
  • Input: number
  • Output: number (float)
  • Examples. In the following expression, the input column mynumber contains an integer, but the function outputs a float. If mylink.mynumber contains the value 56, then the following two functions are equivalent, and return the value 1.29629629629629619E+01:
    AsFloat(56/4.32)
    AsFloat(mylink.mynumber/4.32)
    
AsInteger
Treat the given number as an integer.
  • Input: number
  • Output: number (integer)
  • Examples. In the following expression, the input column mynumber contains a double, but the function is output an integer. If mylink.mynumber contains the value 56, then the following two functions are equivalent, and return the value 12:
    AsInteger(56/4.32)
    AsInteger(mylink.mynumber/4.32)
    
MantissaFromDecimal
Returns the mantissa from the given decimal.
  • Input: number (decimal)
  • Output: result (dfloat)
  • Examples. If mylink.number contains the number 243.7675, then the following two functions are equivalent, and return the value 7675:
    MantissaFromDecimal(243.7675)
    MantissaFromDecimal(mylink.mynumber)
    
MantissaFromDFloat
Returns the mantissa from the given dfloat.
  • Input: number (dfloat)
  • Output: result (dfloat)
  • Examples. If mylink.number contains the number 1.234412000000000010E +4, then the following function returns the value 1:
    MantissaFromDFloat(mylink.mynumber)