From 9c65eca1287fb34db075f64610459e2688ba0a2c Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Tue, 27 Jun 2023 17:18:15 +0200 Subject: [PATCH] Fix Height conversion and update DateTime comment - Update the comment for DateTime() to accurately describe its functionality - Fix the Height conversion (CentiMeter and MilliMeter) calculations by changing the division to multiplication This commit ensures that the conversion functions work as intended and improves the description for DateTime(). --- height.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/height.go b/height.go index 60583cf..db170f1 100644 --- a/height.go +++ b/height.go @@ -20,8 +20,7 @@ func (h Height) IsAvailable() bool { return !h.na } -// DateTime returns true if an Height value was -// available at time of query +// DateTime returns the timestamp associated with the Height value func (h Height) DateTime() time.Time { return h.dt } @@ -64,7 +63,7 @@ func (h Height) CentiMeter() float64 { if h.na { return math.NaN() } - return h.fv / 100 + return h.fv * 100 } // CentiMeterString returns the Height type as formatted string in centimeters @@ -77,7 +76,7 @@ func (h Height) MilliMeter() float64 { if h.na { return math.NaN() } - return h.fv / 1000 + return h.fv * 1000 } // MilliMeterString returns the Height type as formatted string in millimeters