GUILayout label shows value twice when using .ToString()

GUILayout label shows value twice when using .ToString() and a custom GUIStyle

var customLabelTotalValue : GUIStyle;

function OnGUI () {
  var totalValue : int = 5;
  GUILayout.BeginArea(Rect(0,0,Screen.width,Screen.height));
    GUILayout.Label(totalValue.ToString(), customLabelTotalValue);
  GUILayout.EndArea();
}

It doesn’t do it with normal text, just when using .ToString()

Any thoughts on how to prevent that from happening?

Thanks,
Andy

Looks like you accidentally attached you script twice to 2 different object.

In Inspector, select your script, click mouse right button and choose Find References In Scene and it will show you all objects which use this script.

And do that in play mode.

Do you have other script running something similar at the same time?

You may wish to try adjusting the Alignment to Middle Right under Inspector and see if both “5” changes its position.