Merge branch 'ps1' into 'main'

changes EBIT利润率含投资收益参数修改

See merge request root/IndexCalculation!19
This commit is contained in:
彭森 2023-01-05 06:18:40 +00:00
commit 8794e3617f
1 changed files with 2 additions and 2 deletions

View File

@ -9,13 +9,13 @@ router = APIRouter()
class Params(BaseModel):
利润总额: float
计入财务费用的利息支出: float
营业收入: float
营业收入_含投资收益: float
@router.post("/{}".format(INDEX))
def func(p: Params):
try:
result = (p.利润总额 + p.计入财务费用的利息支出) / p. 营业收入 * 100
result = (p.利润总额 + p.计入财务费用的利息支出) / p. 营业收入_含投资收益 * 100
return round(result, 2)
except ZeroDivisionError: