I have 2 variables
vitalidad & maxvitalidad
I want show both in the same label (called lblvitalidad) that they looks like
xxx / xxx
lblvitalidad.Text = String.Format("%d", vitalidad," / %d",maxvitalidad);
But it just show the first variable (vitalidad).
I take the example from the users guide =
You can display as many variables as you like in one line:
Display("Life is %d, 2 x Pi = %f, and my dinner is %s.", life, twoPi, "awful");
and replace it with my own variables
lblvitalidad.Text = String.Format("%d, vitalidad, / %d.", maxvitalidad);
but it shows the second variable (maxvitalidad)
What im doing wrong now? ::)
JpGames
That's how you can do it:
lblvitalidad.Text = String.Format( "%d / %d", vitalidad, maxvitalidad );
Thank you very much. It works perfect ;D