From 20360c075dcb4cbedefe968cd88eff52675e193d Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 05 一月 2024 10:32:05 +0800 Subject: [PATCH] 10090 【后端】越南货币价格(coin与越南盾默认1:1;充值表增加货币类型字段;充值表配置代币充值;) --- ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py b/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py index 3e65f93..428a919 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py @@ -560,10 +560,11 @@ return "" def RMBToCoin(floatRMB): - ''' 元转为分,统一函数,方便修改及搜索 + ''' 元转为coin,统一函数,方便修改及搜索 @param floatRMB: 单位元,float 类型,支持 RMB 或 美元 - @return: 转化为分数值 + @return: 转化为coin数值 ''' - # 由于float会有不精确的现象出现xxx.9999999的问题,所以这里计算出的结果向上取整 - return int(math.ceil(floatRMB * 100)) + # 由于float会有不精确的现象出现xxx.9999999或xxx.0000000000001的问题,所以这里计算出的结果向上取整 + rate = 1 # 越南版本配表及coin均使用越南盾原值,即比例为1:1 + return int(math.ceil(round(floatRMB * rate))) -- Gitblit v1.8.0