You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I was stydying your library to see if I could adapt it to work with TM1637 modules with decimal dot and I've found out it does not handle well floats.
For example.
If I print -1 (as int) the display shows correctly -1
If I print "-1" (as string) the display shows correctly -1
But if I print -1.0 (as float) the display shows -_0
Something similar happens with positive numbers. 1.0 prints as _0
I'm looking at the Print.cpp file and at your library but I yet have to figure out where the error is. But there's definitely an error.
Anyway, thanks for this amazing library. I hope to improve it for decimal dots but first I have to undestand it!! haha
The text was updated successfully, but these errors were encountered:
gonzabrusco
changed the title
Not treating negative numbers correctly
Not treating negative float numbers correctly
Aug 30, 2018
gonzabrusco
changed the title
Not treating negative float numbers correctly
Not treating float numbers correctly
Aug 30, 2018
It looks that the problem comes from the way you implemented the write functions. In one write function you use the buffer _rawBuffer but in the others you don't. So when the Print function mixes both write functions, this problems arise.
Hi @Chinoforest thanks for looking in to this problem! You are more then welcome to make a pull request. Always too much things to do with too little time. I will try to solve this issue when I find some time to improve the library. In the meantime, perhaps I should add some current limitation to the README, there are a couple more things which don't work the way I like.
Hello. I was stydying your library to see if I could adapt it to work with TM1637 modules with decimal dot and I've found out it does not handle well floats.
For example.
If I print -1 (as int) the display shows correctly -1
If I print "-1" (as string) the display shows correctly -1
But if I print -1.0 (as float) the display shows -_0
Something similar happens with positive numbers. 1.0 prints as _0
I'm looking at the Print.cpp file and at your library but I yet have to figure out where the error is. But there's definitely an error.
Anyway, thanks for this amazing library. I hope to improve it for decimal dots but first I have to undestand it!! haha
The text was updated successfully, but these errors were encountered: