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

Fancy fraction formatting #386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mustache0110
Copy link
Contributor

2 reasons behind this feature:

  1. A number of people expressed confusion with octeract costs because they're used to seeing the / as a level separator.
  2. I like how it looks
    image

I dropped in a flexible helper function, but it could be simplified. If @Pseudonian wants to put it directly in format, we can just have the fractional code output .innerHTML code. Then for the few elements that use fractional code, calling DOM('element').innerHTML = format(sometimes fractional number) will work fine when the number is big or small. I'll push this idea as a separate commit, because simpler might be better.

The more complicated change could avoid innerHTML use by showing/hiding a fractional container and setting the numerator and denominator as .textContent. I don't think this is necessary, I'm not sure.

@mustache0110 mustache0110 marked this pull request as draft November 9, 2022 14:18
@mustache0110
Copy link
Contributor Author

mustache0110 commented Nov 12, 2022

image

  • Fixed merge conflict with recent format( ) changes.
  • Adjusted font size for better readability; changed text alignment to be much less disruptive to the line above.

Font size could be nudged up or down, but current size seems to be a good balance between standing out and legibility.

@mustache0110 mustache0110 marked this pull request as ready for review November 12, 2022 16:32
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

Successfully merging this pull request may close these issues.

1 participant