Can I show a numeric variable from the slider on the GUI?

I tried to have this code added so I can have a slider, label, and the current value of the slider shown on screen. I get errors when I try to read the variable boatSpeed_Knots. How would I do this?

static var boatSpeed_Knots : double = 10.0;

function OnGUI () {
    GUI.Box (Rect (10, 20, 100, 25), "Knots");
    boatSpeed_Knots = GUI.HorizontalSlider (Rect (10, 50, 150, 30), boatSpeed_Knots, 0.0, 40.0);
    GUI.Box (Rect (110, 20, 40, 25), boatSpeed_Knots);
}

You need to change boatSpeed_Knots into a string for the label to properly display it.

You can do this with either

"Speed = " + boatSpeed_Knots

or

boatSpeed_Knots.ToString()