pyspark.sql.functions.
rint
Returns the double value that is closest in value to the argument and is equal to a mathematical integer.
New in version 1.4.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
target column to compute on.
the column for computed results.
Examples
>>> df = spark.range(1) >>> df.select(rint(lit(10.6))).show() +----------+ |rint(10.6)| +----------+ | 11.0| +----------+
>>> df.select(rint(lit(10.3))).show() +----------+ |rint(10.3)| +----------+ | 10.0| +----------+