How to display extra 0 at the end of decimal

Hi. I’m using this to display my rounded to 2 decimal points float:

myValue = Mathf.Round((someOtherValue + someOtherValue2) * 100) / 100;
guiObject.text = "Value: " + myValue;

The problem is, that when myValue is eg. 1.50, it displays 1.5 but i want it to display 1.50.
When myValue is 1.55, it’s ok. What can i do to display my extra zero at the end on myValue?

Check out standard numeric format strings on MSDN, string.Format or Formatting Numeric Results Table.

Here’s a snippet you can try:

guiObject.text = String.Format("Value: {0:F2}", myValue);

`float myValue;
Text canvasText;

myValue = Mathf.Round(myValue * 100) / 100;
canvasText.text = myValue.ToString(“F2”) + " some text here";

`