Skip to main content

round

Function round 

Source
pub fn round<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, <E::SQLType as RoundingPolicy<V::DialectMarker>>::Output, E::Nullable, E::Aggregate>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: RoundingPolicy<V::DialectMarker>,
Expand description

ROUND - rounds a number to the nearest integer (or specified precision).

Returns a dialect-aware float type, preserves nullability.

ยงExample

use drizzle_core::expr::round;

// SELECT ROUND(users.price)
let rounded = round(users.price);