Skip to content

Conversation

@JonathanLindsey
Copy link

This adds support for

  1. Negative integers with leading zeros
  2. Floating point numbers

Notes for floating point numbers

  1. This assumes the display has exactly 4 digits.
  2. Only supports use of the colon (not decimal points) for now. Implementation theoretically allows for decimal points to be added later without breaking changes. - I can't get the displays I bought to show decimal points.
  3. When -1 < num < 1 and leading_zero is false, superfluous leading zeros may be shown. This is documented with a note that this behavior may change in the future.
  4. Implementation does not include length and pos arguments but these can theoretically be added in the future without breaking changes.

@JonathanLindsey JonathanLindsey marked this pull request as draft October 26, 2023 14:44
@JonathanLindsey
Copy link
Author

JonathanLindsey commented Oct 26, 2023

There are some things I want to change/fix before this gets merged.

  • Instead of passing the DecimalType enum as an argument, I'll change the function name to showNumberFloatColon(). This is less typing for the user.
  • Fix an integer overflow bug causing floating point numbers like 700 to get messed up in the current implementation.
  • "Support" numbers that are too high or low to fit on a 4 segment display by showing HIGH and LO__ messages.
  • Support Inf, -Inf, and NaN by displaying _InF, -InF, and nAn_

If you think LO__ or nAn_ should be right justified, let me know.

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