Skip to content

Support for floating point numbers without leading zeros #417

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
zimmermm opened this issue Jul 16, 2019 · 3 comments · Fixed by #418
Closed

Support for floating point numbers without leading zeros #417

zimmermm opened this issue Jul 16, 2019 · 3 comments · Fixed by #418

Comments

@zimmermm
Copy link

Hi Jacob
I'd be happy if your library supports the following floating-point number notations in the JSON file:

  • .5 instead of 0.5
  • 1.2D-5 as the notation for double-precision numbers
@jacobwilliams
Copy link
Owner

Be aware those are not valid JSON numeric values. But, I can add support for them as an extension (via an optional argument to initialize). I was also thinking of allowing positive numbers that start with + (also invalid in JSON).

@zimmermm
Copy link
Author

yes, I am aware of that. We use JSON as an input-file format for our model. But now we use a calibration software where we can't control the number format. There are other workarounds for that but I thought if it is possible to extend your library to non-standard formats this would be a nice solution.
Support for comments would be a nice thing too but is also not valid.

@jacobwilliams
Copy link
Owner

Note: comments are supported! Use the optional comment_char input to initialize to set the character to use for comments (e.g., '!', '#' or '\').

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants