Skip to main content

trunc

Function trunc 

Source
pub fn trunc<'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

TRUNC - truncates a number towards zero.

Returns a dialect-aware float type, preserves nullability.

ยงExample

use drizzle_core::expr::trunc;

// SELECT TRUNC(users.price)
let truncated = trunc(users.price);