formatted speed to show km/h too

This commit is contained in:
Sem van der Hoeven
2020-10-09 12:01:23 +02:00
parent b5ea137bad
commit 2aa736b0a8
2 changed files with 8 additions and 24 deletions

View File

@@ -187,23 +187,7 @@ namespace RH_Engine
public string showBikespeed(string uuidPanel, string serialCode, double speed)
{
//dynamic payload = new
//{
// id = "scene/panel/drawtext",
// serial = serialCode,
// data = new
// {
// id = uuidPanel,
// text = "Speed: " + speed + " m/s",
// position = new int[] { 4, 24 },
// size = 36.0,
// color = new int[] { 0, 0, 0, 1 },
// font = "segoeui"
// }
//};
//return JsonConvert.SerializeObject(Payload(payload));
return showOnPanel(uuidPanel, serialCode, "Speed: " + speed + " m/s", 0);
return showOnPanel(uuidPanel, serialCode, $"Speed: {string.Format("{0:.##}", speed)} m /s ({string.Format("{0:.##}", speed * 3.6)} km/h)", 0);
}
public string showHeartrate(string uuidPanel, string serialCode, int bpm)