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
In our application, we'd like to use the color defined in the format string if it is explicitly specified, falling back to some other default if not.
Unfortunately it seems numfmt returns black in both of these cases and there's no way to discern whether black has been explicitly specified for the given value or not. Formatter.info almost does this, but only for negative values.
Might you consider either providing more detail in formatter.info for the non-negative cases, or providing some metadata at format time to indicate whether black was specified?
More drastically, maybe it could not return black in the unspecified case? (I suppose this would be a breaking change).
Happy to try to cut a PR if we can agree on a direction.
The text was updated successfully, but these errors were encountered:
I think both having better details in info and not returning a value if none was specified are better than the current behavior is. 🙂 There is the possibility of having this as an option as well. I've done that for a few backwards incompatible things recently.
I am currently looking more critically at the library. There are a number of things that can be simplified quote a lot and so I may just do a breaking major version update and fix the color function.
In our application, we'd like to use the color defined in the format string if it is explicitly specified, falling back to some other default if not.
Unfortunately it seems numfmt returns
black
in both of these cases and there's no way to discern whether black has been explicitly specified for the given value or not. Formatter.info almost does this, but only for negative values.Might you consider either providing more detail in
formatter.info
for the non-negative cases, or providing some metadata at format time to indicate whether black was specified?More drastically, maybe it could not return
black
in the unspecified case? (I suppose this would be a breaking change).Happy to try to cut a PR if we can agree on a direction.
The text was updated successfully, but these errors were encountered: