From: Clément de l'Hamaide Date: Tue, 30 Dec 2014 16:19:19 +0000 (+0100) Subject: Revert "Altimeter: fix output format for hPa/InHg settings" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=49ce7cd318d00be44c43cffea028a6556104fe18;p=flightgear.git Revert "Altimeter: fix output format for hPa/InHg settings" Replaced by some line of Nasal, that way we don't touch the internal precision of the altimeter This reverts commit 84a26de9ae9ade8629dee53cac8b9357f0930690. --- diff --git a/src/Instrumentation/altimeter.cxx b/src/Instrumentation/altimeter.cxx index 00e6bb4b3..a691f1e90 100644 --- a/src/Instrumentation/altimeter.cxx +++ b/src/Instrumentation/altimeter.cxx @@ -52,7 +52,7 @@ Altimeter::~Altimeter () double Altimeter::getSettingInHg() const { - return int(_settingInHg*100.0)/100.0; /* return only 2 decimals: xx.xx */ + return _settingInHg; } void @@ -61,14 +61,14 @@ Altimeter::setSettingInHg( double value ) _settingInHg = value; } -int +double Altimeter::getSettingHPa() const { - return int(_settingInHg * SG_INHG_TO_PA / 100.0); /* return an INT: xxxx */ + return _settingInHg * SG_INHG_TO_PA / 100; } void -Altimeter::setSettingHPa( int value ) +Altimeter::setSettingHPa( double value ) { _settingInHg = value * SG_PA_TO_INHG * 100; } diff --git a/src/Instrumentation/altimeter.hxx b/src/Instrumentation/altimeter.hxx index a9b32d9a4..45c3a4e61 100644 --- a/src/Instrumentation/altimeter.hxx +++ b/src/Instrumentation/altimeter.hxx @@ -43,8 +43,8 @@ public: double getSettingInHg() const; void setSettingInHg( double value ); - int getSettingHPa() const; - void setSettingHPa( int value ); + double getSettingHPa() const; + void setSettingHPa( double value ); private: std::string _name;