General information
Title:
Entering numeric-like text in class property
I want to enter a string that looks like a number such as 1.0 in a class property "version". If I enter it as 1.0 (without quotes) the class treats it as a numeric so I have to do str(obj.version) to get it to text. But then I may need "1.0" so I need str(obj.version,3,1)... or I might need "1" so str(obj.version,3,1) won't work. I can enter "1.0" in the class property but then sometext="Version: " + obj.version shows 'Version: "1.0"' What is the best way around this? Do I have to enter it as "1.0" in the class then strtran the quotes out whenever I need it?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only