Skip to content
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

Overbars #4

Open
epmoyer opened this issue Aug 21, 2017 · 2 comments
Open

Overbars #4

epmoyer opened this issue Aug 21, 2017 · 2 comments

Comments

@epmoyer
Copy link
Collaborator

epmoyer commented Aug 21, 2017

William,

I'm not going to drag over-bars into the scope of the already broad PR we're working on, but it turns out that there is a "COMBINING_OVERLINE" Unicode character (\u0305) that places an overline over the character it follows. One would have to deal with Python2 vs. 3 Unicode issues, and it wouldn't be useful to people unless the output device their data was headed for supported it (so it would have to be a unique mode option), but at least it is possible.

>>> print("130\u03050")
130̅0
>>>

Food for thought :)

@epmoyer
Copy link
Collaborator Author

epmoyer commented Aug 29, 2017

William,

I have an overbar implementation which is coming along nicely. It's over here if you'd like to take a peek:
https://github.com/epmoyer/to-precision/tree/overbar

I've added Travis CI integration and am currently testing against Python 2.7, & 3.3 -> 3.6
It's nearly finished. Remaining on my todo list is:

  • Run demonstration.py as part of tests.py, just to check that it doesn't crash (i.e. not to validate the output). That will ensure, over time, that Travis catches any incompatibilities across Python versions.
  • Step away for a day :) I need a little distance before I go back and review.

It turns out that GitHub's markdown engine does not properly handle the Unicode overbar when it occurs within a code block. For example, the value in the post above actually ends in two zeros (the first of which has an overbar), but the second zero does not render (though it is visible in "edit" mode"). To circumvent the rendering issue I embedded an image in the README.md to show the behavior of the new convention option.

Cheers!

@BebeSparkelSparkel
Copy link
Owner

This is a good option.

What do you think about converting these values back integers or floats for people because that starts to become a problem if being stored for later use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants