Comments (4)
If you want rounded numbers in the temperature you can change this in weather-card.js on line 168:
: stateObj.attributes.temperature}</span
to
: Math.round(stateObj.attributes.temperature)}</span
For Fahrenheit it seems to already round the numbers.
from weather-card.
At the moment I'm using Fahrenheit and it is displaying one digit after the decimal point for the forecast highs and lows. I was hoping for an option to display those rounded as well.
from weather-card.
Update: So I wrote my code to round the numbers correctly. Unfortunately, it seems that modifying the .js file on a card installed via HACS doesn't change anything. Instead, I had to uninstall the card from HACs and install it manually, and then modify lines 282 and 287.
<div class="highTemp">
${Math.round(daily.temperature)}${this.getUnit("temperature")}
...
<div class="lowTemp">
${Math.round(daily.templow)}${this.getUnit("temperature")}
from weather-card.
I ended up doing something similar, decimal precision isn't necessary for predicted temperatures.
Update: So I wrote my code to round the numbers correctly. Unfortunately, it seems that modifying the .js file on a card installed via HACS doesn't change anything.
For future reference, you don't need to go through the trouble of uninstalling if you want to edit the js file. Generally a gz file is used to save bandwidth when transferring the file to clients, which you can find in the same directory. You can either delete that or gzip your updated file and it will be picked up. gzip -kf weather-card.js
from weather-card.
Related Issues (20)
- Change colors font HOT 4
- Incorrect precipitation from Met Office Weather Integration HOT 1
- Vertical View [FR]
- Uncaught TypeError: css is not a function HOT 6
- v1.4.7 doesn't load HOT 8
- almost all versions except master won't load HOT 4
- not working HOT 18
- Icons do not load the first time on iPhone companion app HOT 1
- Versions 1.4.7 and 1.5.0 not tagged as releases HOT 3
- Night time icons not correctly loading
- Pressure is reported incorrectly when you click on the card HOT 1
- Feature Request: Ability to edit details HOT 1
- Time format does not follow Home assistant settings HOT 1
- Chrome and app crashes on some android devices
- Suggestion for better animated icons
- Units don't follow setting in HA HOT 2
- Project looks abandoned, last update was Sep 2, 2021 HOT 1
- Shows the same data for hourly and daily HOT 7
- Higher CPU Load by animated icons HOT 1
- Entity not available: openweathermap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weather-card.