refactor: round hashrate to 2 decimals for influx

This commit is contained in:
Upstream Data
2025-03-03 14:33:55 -07:00
committed by Brett Rowan
parent 2e192a1536
commit 5bb04b2af4
2 changed files with 2 additions and 2 deletions

View File

@@ -381,7 +381,7 @@ class MinerData(BaseModel):
return f'{key}="{value}"'
def serialize_algo_hash_rate(key: str, value: AlgoHashRateType) -> str:
return f"{key}={float(value)}"
return f"{key}={round(float(value), 2)}"
def serialize_list(key: str, value: list[Any]) -> str | None:
if len(value) == 0:

View File

@@ -84,7 +84,7 @@ class HashBoard(BaseModel):
return f'{key}="{value}"'
def serialize_algo_hash_rate(key: str, value: AlgoHashRateType) -> str:
return f"{key}={float(value)}"
return f"{key}={round(float(value), 2)}"
def serialize_bool(key: str, value: bool):
return f"{key}={value}"