-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: apply global --ofmt to floating-pointable fields on output #252
Comments
OK. So the idea is to leave the input as-is. Another issue is that JSON (unlike all the other formats) has quotes around strings else not, which is something that other formats don't have. So Miller with JSON output tries to test if a given value is a number, and so print the value as-is. So this isn't about There are already an awful lot of JSON-specific This seems inelegant but I'm not sure of a more elegant solution honestly. |
This is in file-formats.html#Formatting_JSON_options (see also head docs http://johnkerl.org/miller-releases/miller-head/doc/file-formats.html#Formatting_JSON_options) and will go out in 5.6.0. |
@johnkerl thank you. But probably I must explain myself better. If I have this CSV
and I want to have all numbers as float number with 2 decimals
I can use DSL and But looking at the JSON output, mlr knows that Base_Price, Promotion_Price, Discount are numeric.
My feature request is to have something like |
Ah OK. |
Easiest I think will be a new verb, |
And I'll revert the |
What about |
OK. So there are strings, ints, and floats which can be auto-detected. |
Wow I have no more words!! Thank you very much |
:) |
I just discovered |
Hi,
with this kind of input
Miller knows that Base_Price, Promotion_Price, and Discount are floating. In example if you use mlr to create a JSON you have:
My feature request is to add --ofmt option also in cat
to have
The text was updated successfully, but these errors were encountered: