Use string interpolation
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 29 May 2016 19:02:32 +0000 (21:02 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 29 May 2016 19:02:32 +0000 (21:02 +0200)
src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTrigger.kt

index 0522b02..264022f 100644 (file)
@@ -86,14 +86,14 @@ class WeatherTrigger : Trigger {
                         }
                         div("hour-state") {
                             div("time") { +"%tH:%<tM".format(startTime.plus(it.hourIndex.toLong(), ChronoUnit.HOURS).toEpochMilli()) }
-                            div("temperature") { +"%d °C".format(it.temperature) }
+                            div("temperature") { +"${it.temperature} °C" }
                             if (showFeltTemperature) {
                                 div("felt-temperature") { +if (it.feltTemperature != null) "(${it.feltTemperature} °C)" else "" }
                             }
-                            div("rain-probability") { +"%d%%".format((it.rainProbability * 100).toInt()) }
-                            div("rain-amount") { +"%s l/m²".format(it.rainAmount.minDigits()) }
+                            div("rain-probability") { +"${it.rainProbability.times(100).toInt()}%" }
+                            div("rain-amount") { +"${it.rainAmount.minDigits()} l/m²" }
                             div("wind-direction") { +it.windDirection.arrow }
-                            div("wind-speed") { +"%d km/h".format(it.windSpeed) }
+                            div("wind-speed") { +"${it.windSpeed} km/h" }
                             if (showGustSpeed) {
                                 div("gust-speed") { +if (it.gustSpeed != null) "(up to ${it.gustSpeed} km/h)" else "" }
                             }