Racing timer problem

I am trying to implement a racing timer in the format : 00:00:00, (minutes,seconds,fractions).
Using the search in the forum I have found this lines, (the code is not complete but this are the conflicted lines):

var currentTime = Time.time - startTimer;

var roundedTimer = Mathf.FloorToInt(currentTime);

displaySeconds = roundedTimer % 60;
displayMinutes = roundedTimer / 60;
displayFractions = (roundedTimer*100) % 100;

And the format for the GUI is:

Current = String.Format (“{0:00}:{1:00}:{2:00}”, displayMinutes, displaySeconds,displayFractions);

The case is if I use : “MathFloorToInt” I don´t get fractions (only minutes and seconds) and if I don’t use that function the problem is although I get fractions ok but whenever the seconds reaches 30 the minutes go up… ??
I know I have to use a function like “MathFloorToInt” or similar but I want the fractions to be displayed also, so
any idea to solve this?

Thanks

you basically have a spelling error in the code the code that you wrote says “Mathf.FloorToInt(currentTime);”
you supossed to put instead: “Mathf.FloatToInt(currentTime);”
that code supposed to convert the float numbers to integers, there is no such thing as a floor number is you see what i mean.

good luck hopefully it works.

foxter888, thanks but I think it is FloorToInt, please look at the Documentation.