mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Promote float to double in cpp code gen
This commit is contained in:
parent
424b12ee36
commit
a8eb44b739
1 changed files with 2 additions and 2 deletions
|
@ -3542,12 +3542,12 @@ fn compile_builtin_function_call(
|
|||
format!("std::atan2({}, {}) / {}", a.next().unwrap(), a.next().unwrap(), pi_180)
|
||||
}
|
||||
BuiltinFunction::ToFixed => {
|
||||
format!("[](float n, int d) {{ slint::SharedString out; slint::cbindgen_private::slint_shared_string_from_number_fixed(&out, n, std::max(d, 0)); return out; }}({}, {})",
|
||||
format!("[](double n, int d) {{ slint::SharedString out; slint::cbindgen_private::slint_shared_string_from_number_fixed(&out, n, std::max(d, 0)); return out; }}({}, {})",
|
||||
a.next().unwrap(), a.next().unwrap(),
|
||||
)
|
||||
}
|
||||
BuiltinFunction::ToPrecision => {
|
||||
format!("[](float n, int p) {{ slint::SharedString out; slint::cbindgen_private::slint_shared_string_from_number_precision(&out, n, std::max(p, 0)); return out; }}({}, {})",
|
||||
format!("[](double n, int p) {{ slint::SharedString out; slint::cbindgen_private::slint_shared_string_from_number_precision(&out, n, std::max(p, 0)); return out; }}({}, {})",
|
||||
a.next().unwrap(), a.next().unwrap(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue