Meaning of {1:0.##} in string.format

Hi there,

I am doing Practice 4 of Data Manipulation in the RPA Developer Foundation course and I have a question regarding the string.format method.

Say I have a dictionary called Cities which contains cities(string) as keys and weight(double) as values. I want to create an input dialogue that lets me choose from the cities and returns the weight accordingly. Hence I have created a new variable of string datatype called chosenCity as the Result of the input dialogue.

Next I was trying to use if, the condition is:
chosenCity isnot nothing

Then:
String.Format(“The combined weight for {0} is {1:0.##}”, chosenCity, Cities(chosenCity))

Else:
“nothing was chosen”

My questions is:
The {1:0.##} in the string.format method was actually copied from the answers, but I don’t really understand what it means and how it Cities(chosenCities) can refer to it.
Also, is there any source where I can learn more about how to use these in string.format method?

Thank you.

@vanicwl
have a look here: