Skip to content

Commit

Permalink
fix(docs, vrl stdlib): Document that to_int coerces nulls (#21154)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jszwedko committed Aug 26, 2024
1 parent ec3a82a commit 968b5df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/cue/reference/remap/functions/to_int.cue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ remap: functions: to_int: {
The value to convert to an integer.
"""
required: true
type: ["integer", "float", "boolean", "string", "timestamp"]
type: ["integer", "float", "boolean", "string", "timestamp", "null"]
},
]
internal_failure_reasons: [
Expand All @@ -28,6 +28,7 @@ remap: functions: to_int: {
"If `value` is a string, it must be the string representation of an integer or else an error is raised.",
"If `value` is a boolean, `0` is returned for `false` and `1` is returned for `true`.",
"If `value` is a timestamp, a [Unix timestamp](\(urls.unix_timestamp)) (in seconds) is returned.",
"If `value` is null, `0` is returned.",
]
}

Expand Down

0 comments on commit 968b5df

Please sign in to comment.