Time.deltaTime unable to return a int?

Hello everyone.

I would like to have a GuiText display a timer, i have managed to do so in a easy manner, using this code(The important part, i guess):

var power = 0.0;

function Update ()
{
if(Input.GetButton("Jump"))
   {
   power += 1 * Time.deltaTime;
   }
}

The timer works, but displays 6-7 numbers behind the comma like so 1.1234567(an example). Proberly because the variable "power" is a float and not a int. but if i change it to a int like so:

var power = 0; // Changed

    function Update ()
    {
    if(Input.GetButton("Jump"))
       {
       power += 1 * Time.deltaTime;
       }
    }

Then it dose not display anything at all.

So, is there a way to only get it to display 1 number, and notning more whatsoever, instead of 6-7 numbers behind the comma?

Thank you for your time.

Read first: http://unity3d.com/support/documentation/ScriptReference/Mathf.RoundToInt.html

//Time.deltaTime is float.

You can transform float to int by using FloorToInt(), RoundToInt() etc of class Mathf.

Better if u post a part of the code with timer and how u display it.

You can use a format string with ToString() to format it the way you like:

// Time.time == 5.4796462;
Time.time.ToString("0");     // --> "5"
Time.time.ToString("00");    // --> "05"
Time.time.ToString("00.0");  // --> "05.5"

(answer via Bunny83)