Changeset cee5c78 in sasview for src/sas/qtgui/Plotting/ConvertUnits.py
- Timestamp:
- Nov 9, 2017 8:41:55 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 7fb471d
- Parents:
- b3e8629
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/27/17 03:42:57)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:41:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/ConvertUnits.py
- Property mode changed from 100755 to 100644
rb3e8629 rcee5c78 4 4 """ 5 5 import re 6 import string7 6 8 7 def convertUnit(power, unit): … … 11 10 """ 12 11 if power != 0: 13 if string.find(unit,"^") != -1: # if the unit contains a powerer ^12 if unit.find("^") != -1: # if the unit contains a powerer ^ 14 13 toks = re.split("\^", unit) 15 if string.find(toks[0],"/") != -1 or \16 string.find(toks[0],"-") != -1:14 if toks[0].find("/") != -1 or \ 15 toks[0].find("-") != -1: 17 16 if power == 1: 18 17 unit = unit … … 20 19 unit = "(" + unit + ")" + "^{" + str(power) + "}" 21 20 else: 22 if string.find(toks[1],"{") != -1: # if found a {21 if toks[1].find("{") != -1: # if found a { 23 22 find_power_toks = re.split("{", toks[1]) 24 if string.find(find_power_toks[1],"}") != -1: # found }23 if find_power_toks[1].find("}") != -1: # found } 25 24 unit_toks = re.split("}", find_power_toks[1]) 26 if string.find(unit_toks[0],".") != -1:25 if unit_toks[0].find(".") != -1: 27 26 powerer = float(unit_toks[0]) * power 28 elif string.find(unit_toks[0],"/") != -1:27 elif unit_toks[0].find("/") != -1: 29 28 power_toks = re.split("/", unit_toks[0]) 30 29 powerer = power * int(power_toks[0])\
Note: See TracChangeset
for help on using the changeset viewer.