use leptos::prelude::*; use leptos_use::docs::demo_or_body; use leptos_use::{use_intl_number_format, NumberStyle, UseIntlNumberFormatOptions}; #[component] fn Demo() -> impl IntoView { let (number, set_number) = signal(123456.78); let de_nf = use_intl_number_format( UseIntlNumberFormatOptions::default() .locale("de-DE") .style(NumberStyle::Currency) .currency("EUR"), ); let de_num = de_nf.format::(number); let ja_nf = use_intl_number_format( UseIntlNumberFormatOptions::default() .locale("ja-JP") .style(NumberStyle::Currency) .currency("JPY"), ); let ja_num = ja_nf.format::(number); let in_nf = use_intl_number_format( UseIntlNumberFormatOptions::default() .locale("en-IN") .maximum_significant_digits(3), ); let in_num = in_nf.format::(number); view! {

"Number: " {number}

"German currency (EUR): " {de_num}

"Japanese currency (JPY): " {ja_num}

"Indian 3 max significant digits: " {in_num}

} } fn main() { _ = console_log::init_with_level(log::Level::Debug); console_error_panic_hook::set_once(); mount_to(demo_or_body(), || { view! { } }) }