# Truncate Float in Python Truncating floats makes calculations easier in terms of processing. There are two ways to truncate a number in Python – by rounding to the nearest integer or by dropping the digits after the decimal place.

## Truncate Python Float Using round()

The Python `round()` function will round a floating-point number to the nearest integer.

``````number = 46.64359236

truncated = round(number)

print(truncated)
``````
``````47
``````

## Truncate to a Decimal Place in Python

If you need to truncate a float to a specific number of decimal places, use the `round()` function and supply the decimal places to preserve as the second argument.

``````number = 46.64359236

truncated = round(number, 2)

print(truncated)
``````
``````46.64
``````

## Truncate Float Using the Python int() Function

The Python `int()` function will strip the decimal places from a number and turn it into an int without rounding up or down.

``````number = 46.64359236

truncated = int(number)

print(truncated)
``````
``````46
``````

#### Related Tutorials ### Overwrite a File in Python

March 10, 2022 ### How to Convert a String to a Number in Python

October 01, 2020 ### Python Type Conversion and Type Casting

June 14, 2021 ### How to Create Range of Floats in Python

September 15, 2021 ### How to Round Numbers Up and Down in Python

September 28, 2020 May 28, 2021