forked from airgradienthq/arduino
round real value with 2 decimal on server sync data json
This commit is contained in:
1 parent
7c63af5ba9
commit
8c94cea764
5 files changed
+30
-22
No files matched your search
@@ -36,3 +36,7 @@ int AirGradient::getI2cSclPin(void) {
|
||||
String AirGradient::getVersion(void) { return AG_LIB_VER; }
|
||||
|
||||
BoardType AirGradient::getBoardType(void) { return boardType; }
|
||||
|
||||
double AirGradient::round2(double value) {
|
||||
return (int)(value * 100 + 0.5) / 100.0;
|
||||
}
|
||||
@@ -107,6 +107,14 @@ public:
|
||||
*/
|
||||
String getVersion(void);
|
||||
|
||||
/**
|
||||
* @brief Round double value with for 2 decimal
|
||||
*
|
||||
* @param valuem Round value
|
||||
* @return double
|
||||
*/
|
||||
double round2(double value);
|
||||
|
||||
private:
|
||||
BoardType boardType;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user