Int32.From

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Returns a 32-bit integer number value from the given value

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

ArgumentDescription
valueValue to convert.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.
optional roundingModeSpecifies rounding direction when there is a tie between the possible numbers to round to.

If the given value is null, Int32.From returns null. If the given value is number within the range of 32-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 32-bit integer number value applies. See Number.Round for the available rounding modes.

Int32.From("4") equals 4  

Int32.From("4.5", null, RoundingMode.AwayFromZero) equals 5  

Show: