​​​Description
Truncates a Number to only keep a given number of decimal digits.
Syntax
TRUNC(Number [, Number of Kept Digits])
Arguments
Argument | Type | Dimensions | Description |
---|---|---|---|
Number (required) | Number | Any Dimensions | Number to truncate digits from. |
Number of Kept Digits (optional) | Integer | No Dimension or Dimensions of argument Number | Number of digits to keep. By default, no digits are kept. |
Returns
Type | Dimensions |
---|---|
Number | Dimensions of argument Number |
BLANK
if Number of Kept Digits is a negative integer.
Examples
Formula | Result | Description |
---|---|---|
| 2 | All digits from 2.365 are truncated. |
| 2.3 | Only 1 digit from 2.365 is kept. |
|
| The Number of Kept Digits, -1, is invalid. |
Use case: conversion to integers with TRUNC
If you want to convert numerical data containing decimal digits from Number type to Integer type, you can use the following:
By default, using any of the above with no second argument turns numbers with decimals into integers, compatible with Integer type. ROUNDDOWN()
and TRUNC()
return an integer with decimal digits removed.
See also
Excel: TRUNC
More of a hands-on learner?
Talk to your Customer Success Manager about downloading the Functions and Modifiers in Pigment Application into your workspace. It includes examples of every formula and modifier in Pigment!