I want to represent money which is usually to 2DP and I add up items using float values but whenever I have a value that is similar to the one used it only converts it to a string to 1DP.
This seems like its going to be annoying to work around. I'm thinking of using a regular expression and an if statement to add a "0" to the end if the string is only to 1DP but i was wondering if there were any other methods I could use.
Any ideas?
number = 0.60
string = "0.60"
stringofnumber = str(number)
print number
print string
print stringofnumber