In this code:
.text("f64 demo slider"),
Under this code
value requires the data type
How do I declare a variable with a
Numeric data type?
f32 data type I type
let value = 10f32. But how would I do it for Numeric?
I am looking through this but can't seem to find a way to declare a
Numeric data type.
Numeric is a trait, and trait is not type.
trait is an abstract behavior/constraint across types. A variable can have only single type, though the type may be an enum or a trait object.
From the docs, you might try converting
Numeric with something like:
I have not used the crate before, tho.
This cannot work (even if it was of any use here), since
Numeric it not object-safe.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.