fixed issue #7

small-fixes-for-0.3.3
Max Lange 8 years ago
parent 00f686441a
commit 1f088f82ec

@ -283,8 +283,13 @@ class slider():
self.knob_pos.left = self.pos.left + tmp
if type(self.options_list) == bool:
text = self.name + ": " + str(self.value * 100)[:3] + "%"
text = text.replace("0.0", "0").replace(".", "")
#adding a "." to the end to ensure at least one is included
text = str(self.value * 100)[:3] + "."
#removes "." and everything behind it
text = text[:text.index(".")]
#Adds the description and the % at the end
text = self.name + ": " + text + "%"
#Turns text into a pygame.Surface
self.render_text = self.typeface.render(text, True, self.color)
self.is_defined_list = False
else:

Loading…
Cancel
Save