lua - How to math.floor to a decimal in Lua?
问题描述
print(math.floor(12.5928))
The code above prints 12. What do you do to make it print 12.5?
解决方案
print(math.floor(12.5928 * 10) / 10)
推荐阅读
- javascript - 如何使用通行证对用户和管理员进行身份验证
- tsql - 使用T-SQL在SSMS中执行SSIS(包)并返回一个值
- powershell - HKLM 的 Get-ChildItem 为 Windows Powershell 返回的结果少于为 VS2019 的 Developer Powershell 返回的结果
- r - 为什么某些 jsonl 文件无法在 SparklyR 中加载
- java - 异常:java.sql.SQLException:非法连接端口值 '3306:etude'
- app-inventor - MIT App Inventor 2 有没有办法刷新屏幕?
- c# - 使用 Chromium 在 WPF 中自动播放 YouTube 视频
- android - 如何在 Android Studio 中设置数据绑定?
- c++ - 为什么 switch 构造中的声明是合法的?
- python - 使用条件识别行后的 Xlsxwriter 条件格式