- Validate that input is greater than or less than a certain number
- Round values to the nearest integer
addColumn Function
TheaddColumn
function accepts an object as an argument.
internal_key
(String) - required: The internal key used to access a column’s value.label
(String) - required: The user-facing column label that is shown in the interface.column_type
(String) - required: Should be “float”.required
(String) - required: Whether or not the column is required.position
(Optional): The position or order of the column.unique
(Optional): Whether values should be unique.validations
(Optional): An array of built-in data validations. See Built-in Float Validations.transformations
(Optional): An array of built-in data transformations. See Built-in Float Transformations.
Example Code
Built-in Float Validations
TheaddColumn
object accepts an array of validations. Each validation has three properties:
validation_type:
the name of the validationmessage:
the message showed to the end user if the validation failsoptions:
options for the specific validation type
validation_type
, message
and options
. As the example below:
less_than
Specifies that the value must be less than a certain number.greater_than
Specifies that the value must be greater than a certain number.even
Specifies that the value must be even.odd
Specifies that the value must be odd.regex
Specifies that the value must match a regexBuilt-in Float Transformations
The options property ofaddColumn
accepts an array of transformations. Each transformation has two possible properties:
transformation_type:
the name of the transformationoptions:
options for the specific transformation type
transformation_type
and options
. As the example below:
number_of_decimals
This transformation allows you to specify the desired number of decimal places for the float values in the column. For example, if the original value is 3.14159 and you specify 2 decimal places, it becomes 3.14. You should pass anoptions
object to the transformation object with a number_of_decimals
integer value in your desired format.