Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
I hate localization
Browse files Browse the repository at this point in the history
  • Loading branch information
RaithSphere committed Jul 2, 2022
1 parent e82e971 commit ebef190
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions HRM-Windows/HeartRate/HeartRateForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand Down Expand Up @@ -200,7 +201,7 @@ private void Service_HeartRateUpdatedCore(HeartRateReading reading)
var data = reading.RRIntervals;

if (data != null)
{
{
while (pos < data.Length)
{
var interval = data[pos] / 1024M;
Expand All @@ -216,11 +217,13 @@ private void Service_HeartRateUpdatedCore(HeartRateReading reading)

if (HRV == null || HRV.Length == 0)
{
WebSocketComponent.SendMessage(hrmData = ($"{bpm,-4:D}.{HeartRateVariance,8:##0.0000}.{BatteryPercent,-4:D}.") + (isConnected ? "1" : "0"));
hrmData = FormattableString.Invariant($"{bpm,-4:D}.{HeartRateVariance,8:##0.0000}.{BatteryPercent,-4:D}.") + (isConnected ? "1" : "0");
WebSocketComponent.SendMessage(hrmData);
}
else
{
WebSocketComponent.SendMessage(hrmData = ($"{bpm,-4:D}.{HeartRateVariance,8:##0.0000}.{BatteryPercent,-4:D}.") + (isConnected ? "1" : "0"));
hrmData = FormattableString.Invariant($"{bpm,-4:D}.{HeartRateVariance,8:##0.0000}.{BatteryPercent,-4:D}.") + (isConnected ? "1" : "0");
WebSocketComponent.SendMessage(hrmData);
}

var isDisconnected = bpm == 0 ||
Expand All @@ -234,7 +237,7 @@ private void Service_HeartRateUpdatedCore(HeartRateReading reading)
}
else
{
iconText = $"{bpm} beats per min\nHRV: {HeartRateVariance}";
iconText = $"{bpm} beats per min\nHRV: {FormattableString.Invariant($"{HeartRateVariance,8:##0.0000}")}";
}


Expand Down

0 comments on commit ebef190

Please sign in to comment.