fix: round website rates to two decimals

This commit is contained in:
SmartUp Developer
2026-06-30 11:26:48 +08:00
parent a914d3d222
commit 2d1dcb8f9f
6 changed files with 88 additions and 26 deletions
+2 -1
View File
@@ -45,6 +45,7 @@ from app.services.website_sync import (
sync_account_priorities_for_upstream,
)
from app.utils.auth import get_current_user
from app.utils.number import fixed_decimal_number
router = APIRouter(tags=["websites"])
logger = logging.getLogger(__name__)
@@ -339,7 +340,7 @@ def import_groups_from_upstream(
"name": target_name,
"description": group.get("description") or f"Imported from {upstream.name} / {source_name}",
"platform": group.get("platform") or "openai",
"rate_multiplier": _source_group_rate(group),
"rate_multiplier": fixed_decimal_number(_source_group_rate(group), 2),
}
if group.get("rpm_limit") is not None:
create_body["rpm_limit"] = group.get("rpm_limit")