float_as_int
Converts a floating-point number to an integer by truncating the decimal portion.
def float_as_int(
value: float
) - > int
Converts a floating-point number to an integer by truncating the decimal part. Use this when you need to ensure a value is an integer type for operations that do not accept floats, such as list indexing or range boundaries.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The floating-point number to be converted into an integer. |
Returns
| Type | Description |
|---|---|
int | The integer representation of the input value after removing all fractional digits. |