Skip to content

Commit c4939c7

Browse files
authored
fix(io): add space separators in out_mat_l format string (#7454)
When the number of atoms exceeds 150, the columns in Lx/Ly/Lz.dat output files become indistinguishable because the %4d format fields are not separated by spaces. Fixes #6907
1 parent dd2de6e commit c4939c7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/source_io/module_hs/cal_pLpR.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ void ModuleIO::AngularMomentumCalculator::kernel(
273273
// il and jl are indexes of the angular momentum,
274274
// iz and jz are indexes of the zeta functions
275275
// im and jm are indexes of the magnetic quantum numbers.
276-
std::string fmtstr = "%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d";
277-
fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e";
278-
fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e\n";
276+
std::string fmtstr = "%4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d";
277+
fmtstr += " %" + std::to_string(precision*2) + "." + std::to_string(precision) + "e";
278+
fmtstr += " %" + std::to_string(precision*2) + "." + std::to_string(precision) + "e\n";
279279
FmtCore fmt(fmtstr);
280280

281281
// placeholders

0 commit comments

Comments
 (0)