Int8.From

The function Int8.From returns a signed 8-bit integer number value based on the input given. If the input is null, the function returns null as well. If the input is a number within the range of a sig...

Syntax

Int8.From(value as any, optional culture as nullable text, optional roundingMode as nullable number) as nullable number

About

The function Int8.From returns a signed 8-bit integer number value based on the input given. If the input is null, the function returns null as well. If the input is a number within the range of a signed 8-bit integer without any decimal part, the function returns the number as is. If the input has a decimal part, it will be rounded according to the specified rounding mode. The default rounding mode is RoundingMode.ToEven. If the input is of a different type, it will be converted to a number using Number.FromText before processing. Different rounding modes can be used by referring to Number.Round. Additionally, an optional culture parameter can be provided, for example, "en-US".

Explanation

Retrieve the signed 8-bit integer value of "4" by utilizing the Power Query function MInt8.From("4"). This will yield an output of 4. To determine the signed 8-bit integer value of "4.5" while employing the RoundingMode.AwayFromZero method, employ the Power Query function MInt8.From("4.5", null, RoundingMode.AwayFromZero). This will result in an output of 5.