Game Development Community

Truncating strings?

by Robert Lohaus · in Torque 2D Beginner · 11/21/2013 (1:39 pm) · 2 replies

I am have created a frames per second label using the following script:

%str="FPS: " @ mainScene.getFPS();

The problem is that I am getting a float (929.1353). How do I truncate the all decimal places?

Thanks in advance!

#1
11/21/2013 (2:07 pm)
mRound(mainScene.getFPS());

General math functions have their own ScriptBinding file now in the dev branch.

github.com/GarageGames/Torque2D/blob/development/engine/source/math/math_ScriptB...
#2
11/21/2013 (2:34 pm)
Thanks