diff options
author | Thomas White <taw@physics.org> | 2024-01-19 14:24:37 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2024-02-06 16:59:35 +0100 |
commit | ab4388d91a76841b4210840e17b94de826149b84 (patch) | |
tree | f4ec2637c07d27ed3ba2207eab6696fe5f88e40d | |
parent | 3e63a502965b06b10259e8f29ce7f70b7f2550c9 (diff) |
Julia: UnitCell: Fix spurious precision
-rw-r--r-- | julia/CrystFEL/src/cell.jl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/julia/CrystFEL/src/cell.jl b/julia/CrystFEL/src/cell.jl index c098f8ca..bce39c50 100644 --- a/julia/CrystFEL/src/cell.jl +++ b/julia/CrystFEL/src/cell.jl @@ -1,6 +1,7 @@ module UnitCells using Random +using Printf import ..CrystFEL: libcrystfel export UnitCell, LatticeType, CenteringType, UniqueAxis @@ -297,12 +298,9 @@ function Base.show(io::IO, uc::UnitCell) show(io, cen); write(io, ", ") show(io, ua); write(io, ",\n ") let cp = getcellparams(uc) - show(io, cp.a*1e10); write(io, " Å, ") - show(io, cp.b*1e10); write(io, " Å, ") - show(io, cp.c*1e10); write(io, " Å, ") - show(io, rad2deg(cp.α)); write(io, "°, ") - show(io, rad2deg(cp.β)); write(io, "°, ") - show(io, rad2deg(cp.γ)); write(io, "°") + @printf(io, "%.3f Å, %.3f Å, %.3f Å, %.3f°, %.3f°, %.3f°", + cp.a*1e10, cp.b*1e10, cp.c*1e10, + rad2deg(cp.α), rad2deg(cp.β), rad2deg(cp.γ)) end write(io, ")") end |