Leptos-Use Guide

use_round

Reactive round().

Demo

Usage

use leptos::*;
use leptos_use::math::use_round;

#[component]
fn Demo() -> impl IntoView {
let (value, set_value) = create_signal(45.95);
let result: Signal<f64> = use_round(value); // 46

assert_eq!(result.get(), 46.0);
view! { }
}

Feature

This function is only available if the crate feature math is enabled

Source

SourceDemoDocs