Using the correct data type for math operations

Pentaho Data Integration

Version
9.3.x
Audience
anonymous
Part Number
MK-95PDIA003-15

Using the correct data type for math operations helps ensure expected results from your transformations and jobs. The Number, BigNumber, and Integer types offer specific solutions for different computing needs. The following table highlights the behaviors and possible uses for each data type. For information about the proper method to round or truncate numbers, see Applying calculations and rounding.

PDI data type Description
Number
Use for general math with real numbers:
  • Decimal precision is not guaranteed.
  • Normally precise within 15 to 16 decimal points.
  • 15.4 may be represented as 15.400000000000000000001111111
  • 15.498723528092515678989712397 may be 15.498723528092515701252…
BigNumber
Use to get exact results from math of decimal numbers:
  • Guarantees precision to about 2 billion decimal places.
  • Requires more memory than Integer or Number.
  • 15.498723528092515678989712397 will always be 15.498723528092515678989712397
Integer
Use for math without a fraction or a decimal component:
  • Handles minimum and maximum values ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807