Skip to content

Fixed add negative sign for negative double #17

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

Open
otpfiste opened this issue Jun 3, 2022 · 7 comments
Open

Fixed add negative sign for negative double #17

otpfiste opened this issue Jun 3, 2022 · 7 comments

Comments

@otpfiste
Copy link

otpfiste commented Jun 3, 2022

Hi,

for example that is note rendered correctly:
display.showNumber(-3.1, 1, 3, 1);

The solution is to add the negative sign for negative numbers inside the for loop, see attached code which works for both the 4 and the 6 segments versions:
showNumber-double.txt

All the best,
Oliver

@jasonacox
Copy link
Owner

Hi @otpfiste ! Great catch! Thank you. I can make this update but do you want to submit a pull request for this change? It would be nice to have you listed as a contributor.

@otpfiste
Copy link
Author

otpfiste commented Jun 4, 2022

Hi jasonacox,

I'm not good at git (still using svn for my projects), it's better if you make the update, I will then test it if you want.

Thanks,
Oliver

@jasonacox
Copy link
Owner

No problem! Here is the diff (from vscode). I'll update and test for both 4 and 6 digit functions.

image

Thanks again!

@otpfiste
Copy link
Author

otpfiste commented Jun 4, 2022

Yes, it's correct.

Thanks again for your nice library,
Oliver

@jasonacox
Copy link
Owner

jasonacox commented Jun 4, 2022

Thanks, Oliver! I am running test on 4 and 6 digit displays now. I have uploaded the revision to github. I noticed that there was a condition for negative non-floating point numbers that was also not handled so I fixed that as well.

If you can, please test (see 44ac84c). I will upload to the patched version as v1.5.2 for Arduino later today.

@otpfiste
Copy link
Author

otpfiste commented Jun 5, 2022

I updated to v1.5.2 in Arduino IDE and tested it with my 4 and 6 segs displays, all works great!

Note: I re-checked the source code and found several comments to update in TM1637TinyDisplay6.h file:
(0 - leftmost, 3 - rightmost) --> (0 - leftmost, 5 - rightmost)

All the best,
Oliver

jasonacox added a commit that referenced this issue Jun 5, 2022
@jasonacox
Copy link
Owner

Thanks, Oliver! I updated the comments as you mentioned.

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