-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Default to type NUMBER for variables #265
Conversation
Any variable that is not STRING, RANGE or ENUM is just a simple numeric value. The protocol documentation (net-protocol.txt) was previously stating that "The default <type>, when omitted, is integer." which was not fully true, since a variable could also be a float. Hence, the wording was changed to advertise this, and that each driver is then responsible for handling values as either integer or float. Moreover, instead of returning a TYPE "UNKNOWN", return "NUMERIC", which is more suitable, and aligned with the NUT protocol specification
Nothing against this proposal. Just one colateral point: as you "formalize" the fact to be able to deal with integers or floats, perhaps we have to specify which numeric formats are allowed (only decimal english-based representation ?). |
Clarify documentation on how to express float values, when using upsrw. That is to say, using decimal english-based representation, so using a dot
Yes |
mmh..
Given that we're opening the Pandora's jar:
|
As per discussion on the Github pull request, NUMBER would be more suitable than NUMERIC
Clarify a bit more documentation on how to express float values, when using upsrw. That is to say, using decimal (base 10) english-based representation, so using a dot, in non-scientific notation. So hexadecimal, exponents, and comma for thousands separator are forbiden
@zykh : true for both non-scientific notation and NUMBER Vs NUMERIC. I've amended with 2 commits
|
@aquette: sure, those things can wait 2.7.5 |
hem, forgot that there was a branch to merge... |
…tools#265] Signed-off-by: Jim Klimov <[email protected]>
Any variable that is not STRING, RANGE or ENUM is just a simple numeric value.
The protocol documentation (net-protocol.txt) was previously stating that "The
default , when omitted, is integer." which was not fully true, since a
variable could also be a float. Hence, the wording was changed to advertise
this, and that each driver is then responsible for handling values as either
integer or float. Moreover, instead of returning a TYPE "UNKNOWN", return
"NUMERIC", which is more suitable, and aligned with the NUT protocol
specification