I want to round a float with many decimal places, such as 2.638232371
down to one decimal place, such as 2.6
.
I found this will do so:
"%.2f" % 1.93213
#=> 1.93
But what is "%.2f"? and is the result a string? I'd just like to understand how this works.