Skip to content

Commit b98e178

Browse files
allow for superscript decimal oxi states and ensure that negative oxi states do not have leading plus sign
1 parent 267b6ce commit b98e178

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

robocrys/util/util.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def get_formatted_el(
165165
if _oxi_state % 1 == 0:
166166
oxi_state = f"{int(abs(_oxi_state)):d}{sign}"
167167
else:
168-
oxi_state = f"{abs(_oxi_state):+.2f}{sign}"
168+
oxi_state = f"{abs(_oxi_state):.2f}{sign}"
169169
if fmt == "latex":
170170
oxi_state = f"^{{{oxi_state}}}"
171171

@@ -191,10 +191,6 @@ def superscript_number(string):
191191
Returns:
192192
The superscript string.
193193
"""
194-
if "." in string:
195-
# no unicode period exists
196-
return string
197-
198194
subscript_unicode_map = {
199195
0: "⁰",
200196
1: "¹",
@@ -208,6 +204,7 @@ def superscript_number(string):
208204
9: "⁹",
209205
"-": "⁻",
210206
"+": "⁺",
207+
".": "\u1427",
211208
}
212209

213210
for original_subscript, subscript_unicode in subscript_unicode_map.items():

0 commit comments

Comments
 (0)