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().
This commit is contained in:
parent
a4f19380ff
commit
9c65eca128
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue