Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zAxisPopupContent.py to correct inches/mm conversion #534

Merged
merged 2 commits into from
Jan 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions UIElements/zAxisPopupContent.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def units(self):
'''
if self.data.units == "INCHES":
self.data.units = "MM"
self.distBtn.text = str(25*float(self.distBtn.text))
self.distBtn.text = "{0:.2f}".format(25.4*float(self.distBtn.text))
else:
self.data.units = "INCHES"

self.distBtn.text = str(float(self.distBtn.text)/25)
self.distBtn.text = "{0:.2f}".format(float(self.distBtn.text)/25.4)

self.unitsBtn.text = self.data.units

Expand Down Expand Up @@ -90,4 +90,4 @@ def dismiss_popup(self):
self.distBtn.text = str(tempfloat) # Update displayed text using standard numeric format
except:
pass #If what was entered cannot be converted to a number, leave the value the same
self._popup.dismiss()
self._popup.dismiss()