Skip to content

Commit

Permalink
Units : fix wrong Unit symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotl committed Jul 31, 2024
1 parent 4b64471 commit ba5bf84
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Common/Header/Units.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,36 @@ namespace Units {
void FormatMapScale(double Distance, TCHAR *Buffer, size_t size) gcc_nonnull(2);

namespace impl {

struct UnitDescriptor_t {
const TCHAR* const Name;
const double ToUserFact;
const double ToUserOffset;
};

inline constexpr UnitDescriptor_t UnitDescriptors[unLastUnit + 1] = {
inline constexpr
UnitDescriptor_t UnitDescriptors[unLastUnit + 1] = {
{_T(""), 1.0, 0}, // unUndef
{_T("km"), 0.001, 0}, // unKiloMeter
{_T("nm"), 1.0 / 1852, 0}, // unNauticalMiles
{_T("mi"), 1.0 / 1609.344, 0}, // unStatuteMiles
{_T("kh"), 3.6, 0}, // unKiloMeterPerHour
{_T("km/h"), 3.6, 0}, // unKiloMeterPerHour
{_T("kt"), 1.0 / (1852.0 / 3600.0), 0}, // unKnots
{_T("mh"), 1.0 / (1609.344 / 3600.0), 0}, // unStatuteMilesPerHour
{_T("ms"), 1.0, 0}, // unMeterPerSecond
{_T("fm"), 1.0 / 0.3048 * 60.0, 0}, // unFeetPerMinutes
{_T("mph"), 1.0 / (1609.344 / 3600.0), 0}, // unStatuteMilesPerHour
{_T("m/s"), 1.0, 0}, // unMeterPerSecond
{_T("fpm"), 1.0 / 0.3048 * 60.0, 0}, // unFeetPerMinutes
{_T("m"), 1.0, 0}, // unMeter
{_T("ft"), 1.0 / 0.3048, 0}, // unFeet
{_T("FL"), 1.0 / 0.3048 / 100, 0}, // unFligthLevel
{_T("K"), 1.0, 0}, // unKelvin
{_T("°C"), 1.0, -273.15}, // unGradCelcius
{_T("°F"), 9.0 / 5.0, -459.67}, // unGradFahrenheit
{_T("fs"), 1.0 / 0.3048, 0}, // unFeetPerSecond
{_T("fps"), 1.0 / 0.3048, 0}, // unFeetPerSecond
{_T(""), 1.0, 0}, // unLastUnit
};

} // impl

/**
* convert value from System Unit to @unit
*/
Expand Down

0 comments on commit ba5bf84

Please sign in to comment.