Skip to content

Commit 4108d85

Browse files
committed
BUG: fix signedRatStr for near-integer numbers
1 parent 87c1118 commit 4108d85

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/diffpy/structure/symmetryutilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def signedRatStr(self, x):
362362
363363
Return string.
364364
"""
365-
s = str(x)
365+
s = "{:.8g}".format(x)
366366
if len(s) < 6: return "%+g" % x
367367
den = numpy.array([3.0, 6.0, 7.0, 9.0])
368368
nom = x * den

src/diffpy/structure/tests/testsymmetryutilities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ def test___init__(self):
211211
return
212212

213213

214-
@unittest.expectedFailure
215214
def test_signedRatStr(self):
216215
"check GeneratorSite.signedRatStr()"
217216
g = self.g117c

0 commit comments

Comments
 (0)