Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit fa6611c

Browse files
committed
fix: fix formatting again
1 parent 22f36e9 commit fa6611c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/commands/util/weather.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export default class WeatherCommand extends GeneralCommand {
3838
return Math.round(((degree - 32) * 5) / 9);
3939
}
4040

41+
toKph(mph: number) {
42+
return (mph * 1.609).toFixed(2);
43+
}
44+
4145
getCardinal(angle: number) {
4246
const degreePerDirection = 360 / 8;
4347
const offsetAngle = angle + degreePerDirection / 2;
@@ -78,10 +82,10 @@ export default class WeatherCommand extends GeneralCommand {
7882
**Temperature**: ${temperature}°F (${this.toCelsius(temperature)}°C)
7983
Apparent Temperature: ${apparentTemperature}°F (${this.toCelsius(apparentTemperature)}°C)
8084
**Humidity:** ${weather.currently.humidity * 100}%
81-
**Wind Speed:** ${weather.currently.windSpeed} mph (${
82-
weather.currently.windSpeed * 1.609
83-
} kph) ${this.getCardinal(weather.currently.windBearing)}
84-
Wind Gust Speed: ${weather.currently.windGust} mph (${weather.currently.windGust * 1.609} kph)
85+
**Wind Speed:** ${weather.currently.windSpeed} mph (${this.toKph(
86+
weather.currently.windSpeed
87+
)} kph) ${this.getCardinal(weather.currently.windBearing)}
88+
Wind Gust Speed: ${weather.currently.windGust} mph (${this.toKph(weather.currently.windGust)} kph)
8589
${
8690
weather.currently.nearestStormDistance
8791
? `Nearest Storm: ${weather.currently.nearestStormDistance} mi ${this.getCardinal(

0 commit comments

Comments
 (0)