Fix v1 output format: real(feelsLike)

pull/583/head
Igor Chubin 4 years ago
parent f067e82956
commit ba19ce8264

@ -661,24 +661,44 @@ func formatTemp(c cond) string {
t = c.TempC2 t = c.TempC2
} }
hyphen := " - " // hyphen := " - "
// if (config.Lang == "sl") { // if (config.Lang == "sl") {
// hyphen = "-" // hyphen = "-"
// } // }
hyphen = ".."
explicitPlus := false // hyphen = ".."
if c.FeelsLikeC < t {
if c.FeelsLikeC < 0 && t > 0 { explicitPlus1 := false
explicitPlus = true explicitPlus2 := false
} if c.FeelsLikeC != t {
return pad(fmt.Sprintf("%s%s%s °%s", color(c.FeelsLikeC, false), hyphen, color(t, explicitPlus), unitTemp[config.Imperial]), 15) if t > 0 {
} else if c.FeelsLikeC > t { explicitPlus1 = true
if t < 0 && c.FeelsLikeC > 0 { }
explicitPlus = true if c.FeelsLikeC > 0 {
} explicitPlus2 = true
return pad(fmt.Sprintf("%s%s%s °%s", color(t, false), hyphen, color(c.FeelsLikeC, explicitPlus), unitTemp[config.Imperial]), 15) }
} if explicitPlus1 {
explicitPlus2 = false
}
return pad(
fmt.Sprintf("%s(%s) °%s",
color(t, explicitPlus1),
color(c.FeelsLikeC, explicitPlus2),
unitTemp[config.Imperial]),
15)
}
// if c.FeelsLikeC < t {
// if c.FeelsLikeC < 0 && t > 0 {
// explicitPlus = true
// }
// return pad(fmt.Sprintf("%s%s%s °%s", color(c.FeelsLikeC, false), hyphen, color(t, explicitPlus), unitTemp[config.Imperial]), 15)
// } else if c.FeelsLikeC > t {
// if t < 0 && c.FeelsLikeC > 0 {
// explicitPlus = true
// }
// return pad(fmt.Sprintf("%s%s%s °%s", color(t, false), hyphen, color(c.FeelsLikeC, explicitPlus), unitTemp[config.Imperial]), 15)
// }
return pad(fmt.Sprintf("%s °%s", color(c.FeelsLikeC, false), unitTemp[config.Imperial]), 15) return pad(fmt.Sprintf("%s °%s", color(c.FeelsLikeC, false), unitTemp[config.Imperial]), 15)
} }

Loading…
Cancel
Save