Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列をフロートに変換し、ベロシティテンプレートで加算操作を行う方法。
私は以下のものを試しましたが、うまくいきませんでした。
$ Float = 0.0
$ stringValue = "5.5"
$ sum = 0.0
$ sum = $ sum + $ Float.parseFloat($ stringValue)。
上記のものも機能しませんでした。「$Float.parseFloat($ stringValue)」は評価されません。
ちょうど答えを見つけました。
$ textutils.parseFloat( "5.5")はそれをfloatに変換できます。
また、他の方法では、クラスファイルでは、Float f = 5.6f; speedtemplate.put( "floatVar"、f); //float変数を速度テンプレートに渡します
テンプレートでは、$ f.parseFloat( "5.5")が機能します。
ありがとうございました。