I have a list:
ls = [1.0, 2.11, 3.981329, -15.11]
I want to add zeros to decimal places of each element so that all values have the same length as the value that has maximum length. So the output should be:
[1.000000, 2.110000, 3.981329, -15.110000]
How can I do this?
Here's an alternative solution. Note that the nums will be strings:
Output: