You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I would like to be able to distinguish between a Value representing integers (ValueRepr::U64, ValueRepr::I64 etc.) and a Value representing a float (ValueRepr::F64).
Right now, there isn't a way to know whether a Value contains a float or int because
The ValueRepr (Value.0) is private
ValueKind considers ints and floats all to be a ValueKind::Number
Converting a Value doesn't reveal this information either, it just converts floats to ints and vice versa:
Hi, I would like to be able to distinguish between a Value representing integers (
ValueRepr::U64
,ValueRepr::I64
etc.) and a Value representing a float (ValueRepr::F64
).Right now, there isn't a way to know whether a
Value
contains a float or int becauseValueRepr
(Value.0
) is privateValueKind
considers ints and floats all to be aValueKind::Number
Value
doesn't reveal this information either, it just converts floats to ints and vice versa:This distinction can be quite useful if you want to format a value differently based on whether it's an int or float for example.
I'm happy to create a PR for this if that helps but I'm not sure what the best approach is.
The text was updated successfully, but these errors were encountered: