已解决 PurPur1.20.4玩家血量变量

芝士太好吃了

【Lv:3】

正式会员
注册
2023/06/27
消息
45
金粒
17,296.59金粒
purpur 1.20.4
使用ap属性插件
显示玩家目前血量与最大血量 %player_health%输入后很多小数点
想取整数 有没有插件或者papi的附属可以解决这个问题?
带个图
e768109ecf12d40bc286142c39ce0cc7.png
 
取整:%player_health_rounded%
保留2位小数:%math_2_{player_health}% (需要安装 math 变量扩展)
 
解决方案
安装Math拓展,使用 %math_1:ceiling_{player_health}% 四舍五入,显示一位小数
 
安装Math拓展,使用 %math_1:ceiling_{player_health}% 四舍五入,显示一位小数
默认(不输入:,即half-up)或者 half-even 才是四舍五入,ceiling 是向上取整
 
最后编辑:

在线会员

  • Happyday
  • catnip0
  • Miyakomikoto
  • AyyyySZ
  • zall11
  • 阿帕兹阿帕兹
  • 红烧羊肉
  • dkxnx
  • yujia
  • zbldyyds
  • HNGYJKL
  • Star_Xun
  • 2151726690
  • wldxxs
  • Zzhljfz10086
  • 6頌君共愛9
  • rnogu
  • uidgyz
  • 夏墨轩
  • Lz_Xc
...和 6 更多。
后退
顶部 底部