Power Query
published
Search
⌃K

Int8.From

Int8.From

Creates a signed 8-bit integer from the given value.
function (optional value as nullable any, optional culture as nullable any, optional roundingMode as nullable any) as nullable any

Description

Returns a signed 8-bit integer number value from the given value. If the given value is null, Int8.From returns null. If the given value is number within the range of signed 8-bit integer without a fractional part, value is returned. If it has fractional part, then the number is rounded with the rounding mode specified. The default rounding mode is RoundingMode.ToEven. If the given value is of any other type, see Number.FromText for converting it to number value, then the previous statement about converting number value to signed 8-bit integer number value applies. See Number.Round for the available rounding modes.

Category

Number.Conversion and formatting

Examples

Get the signed 8-bit integer number value of "4".
Int8.From("4")
4
Get the signed 8-bit integer number value of "4.5" using RoundingMode.AwayFromZero.
Int8.From("4.5", null, RoundingMode.AwayFromZero)
5