round_to

Function round_to 

Source
pub fn round_to<'a, V, E, P>(
    expr: E,
    precision: P,
) -> SQLExpr<'a, V, Double, E::Nullable, Scalar>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: Numeric, P: Expr<'a, V>,
Expand description

ROUND with precision - rounds a number to specified decimal places.

Returns Double type, preserves nullability of the input expression.

§Example

use drizzle_core::expr::round_to;

// SELECT ROUND(users.price, 2)
let rounded = round_to(users.price, 2);