【问题标题】:How can i add another number to end of current number? LUA如何在当前号码的末尾添加另一个号码?卢阿
【发布时间】:2022-01-22 23:49:07
【问题描述】:

你好,我想要和这里完全一样的想法,但是用 LUA 语言

How to add a number on the end of another number

" 我想将一个号码加入另一个号码而不是添加它。 示例:而不是 1 + 1 生成 2,我希望它生成 11。 我认为我唯一能做的就是+1,但这只是让它变成2,我希望它变成11。 "

你能帮我在LUA中怎么做吗?有什么比那个6岁的答案更好的方法吗?

【问题讨论】:

    标签: lua


    【解决方案1】:

    我找到了解决方案:

       function JoinNumber(x, y)       
       local z = tostring(x) .. tostring(y);
       return tonumber(z);
       end
    
       local actionID = JoinNumber(action[2],Config:GetSpec())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-13
      • 1970-01-01
      • 2017-04-28
      • 2015-07-19
      相关资源
      最近更新 更多