Improve calc.round documentation (#6345)

This commit is contained in:
Malo 2025-06-02 14:04:49 +01:00 committed by GitHub
parent 83e249dd33
commit 4329a15a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -708,12 +708,13 @@ pub fn fract(
} }
} }
/// Rounds a number to the nearest integer away from zero. /// Rounds a number to the nearest integer.
/// ///
/// Optionally, a number of decimal places can be specified. /// Half-integers are rounded away from zero.
/// ///
/// If the number of digits is negative, its absolute value will indicate the /// Optionally, a number of decimal places can be specified. If negative, its
/// amount of significant integer digits to remove before the decimal point. /// absolute value will indicate the amount of significant integer digits to
/// remove before the decimal point.
/// ///
/// Note that this function will return the same type as the operand. That is, /// Note that this function will return the same type as the operand. That is,
/// applying `round` to a [`float`] will return a `float`, and to a [`decimal`], /// applying `round` to a [`float`] will return a `float`, and to a [`decimal`],