I am looking to get the variable "a" to two decimal places. I have achieved it using the .format method. However to keep inline with the code I have been using %d. How can I get the variable "a" to two decimal places using %d or is it even possible this way?
a = 10.5678
print("The result is {:.2f} in volts".format(a))
print("The result is %d, in volts" % (a))