Print a numeric variable
MyString = "abc" + str(MyValue) + "def"
MyString += "hij"
Insert variables into a string
Inserting strings
#Insert variables directly (NOTE THE 'f' BEFORE THE STRING!! - requried for this)
my_string = f"Something {string_a} blah {string_b}"
Inserting values
#Insert variables directly (NOTE THE 'f' BEFORE THE STRING!! - requried for this)
my_string = f"Something {str(my_int_value)} blah {str(my_float_value)}"
Decimal places
For a float value
my_string += f"\nBrightness: {round(my_value, 1)}" #Limit value to 1 decimal place
For an integer value
my_string += f"\nBrightness: {round(float(my_value), 1)}" #Limit value to 1 decimal place
Convert string to value
See here
