Add HKO-backed Shek Kong settlement and history support
This commit is contained in:
@@ -23,14 +23,21 @@ def is_exact_settlement_city(city: str) -> bool:
|
||||
"""是否为不四舍五入的精确结算城市"""
|
||||
if not city:
|
||||
return False
|
||||
c = str(city).lower().strip()
|
||||
return c in ["hong kong", "hk", "香港"]
|
||||
normalized = str(city).lower().strip()
|
||||
try:
|
||||
from src.data_collection.city_registry import ALIASES, CITY_REGISTRY
|
||||
|
||||
canonical = ALIASES.get(normalized, normalized)
|
||||
city_meta = CITY_REGISTRY.get(canonical) or {}
|
||||
return str(city_meta.get("settlement_source") or "").strip().lower() == "hko"
|
||||
except Exception:
|
||||
return normalized in ["hong kong", "hk", "香港"]
|
||||
|
||||
|
||||
def apply_city_settlement(city: str, value: Optional[Number]) -> Optional[int]:
|
||||
"""
|
||||
根据城市返回最终的结算值:
|
||||
- 香港: 向下取整 (e.g. 28.9 -> 28)
|
||||
- HKO 系城市: 向下取整 (e.g. 28.9 -> 28)
|
||||
- 其他: WU 规则四舍五入
|
||||
"""
|
||||
if value is None:
|
||||
|
||||
Reference in New Issue
Block a user