Lenght help

Well im making a maths game but as is maths sometimes the results get like many decimals. How can i make that for example when i press the chek button the code is this:

on (release, keyPress "<Enter>")
{
    if (total == f)
    {
        gotoAndPlay(23);
    }
    else if (total != f)
    {
        gotoAndPlay(44);
    } // end else if
}

but f sometimes is too long how can i make it only take 1 decimal???