-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
PREC1 and PREC2 formatting parameters not functioning correct. #3150
Comments
Confirmed: local function run(event)
lcd.clear()
lcd.drawNumber(10, 10, 1234, LEFT)
lcd.drawNumber(10, 20, 1234, PREC1+LEFT)
lcd.drawNumber(10, 30, 1234, PREC2+LEFT)
return 0
end
return { run=run }
That is Lua rounding error when the floating point number is converted to integer. We can't do much about it. |
I also prefer the first option |
The Lua rounding error should be reported in a different issue, perhaps we can do something! |
the rounding doesn't occur when just shifting the decimal. so for that reason I would prefer the second option. It is only a formatting issue, and num2text does it correct. |
Well I have nothing against the 2nd solution, it would be consistent with the firmware itself. Just a little bit more difficult to explain. |
Yes, the second option would be consistent. For a more elaborate string formatting one can use the Lua string library now. |
Bertrand, I am new to all this github stuff. The issue about PREC1 and PREC2, do i see it correct if the original How can I see in which nightly it will be updated so I can test?? Thanks for the reply. Guido Met vriendelijke groet Guido ter Horst On Tue, Dec 15, 2015 at 7:07 AM, Bertrand Songis notifications@github.com
|
15 hours, it will be in the nightly builds tomorrow morning! |
Perfect. If this is fixed, I have to do some final testing, and then I can release my updated F3K toolset.compatible with 2.0 and 2.1. :) |
Any news concerning this bug? |
It's fixed in 2.1.7 |
@projectkk2glider my bad - I haven't seen that it's closed already. |
the "PREC1" parameter used to format numbers being printed with1 decimal is working differently. It used to just place a decimal point before the last whole number digit. Now it seems to just give the 1/10 value in the output after the digit, so it is really only a "format" parameter.
value 67, OLD 'PREC1' format output: 6.7, new 'PREC1' format output: 67.0
also, there seem to be some rounding errors. 8.2 is formatted as 8.19 with 'PREC2'
The text was updated successfully, but these errors were encountered: