-
Notifications
You must be signed in to change notification settings - Fork 42
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
number | remove obsolete numDecimalPlaces
#71
Conversation
✅ Deploy Preview for esphome-webserver ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
numDecimalPlaces
numDecimalPlaces
numDecimalPlaces
numDecimalPlaces
max="${max || Math.max(10, val)}" | ||
.value="${(val.toFixed(numDecimalPlaces))}" | ||
min="${min || Math.min(0, value as number)}" | ||
max="${max || Math.max(10, value as number)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not terribly important, but by keeping const val = Number(value);
(or const val = parseFloat(value);
), the type casting as number
can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Since we made sure the
web_server
sends the the values with the right 'accuracy' we no longer need to parse the decimal places with the help of thestep