Skip to content

Commit 15a189c

Browse files
committed
Make sure we display enough digits for step size in out catalog
1 parent e12a8f9 commit 15a189c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/fast++-write_output.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ std::string pretty_dust_law(const std::string& law, float eb, float delta) {
3333

3434
template<typename T>
3535
std::string pretty_grid(T x0, T x1, T step, uint_t ndecimal) {
36+
if (step != 0) {
37+
uint_t ndecimal_step = max(0u, -floor(log10(step)));
38+
if (ndecimal_step > ndecimal) {
39+
ndecimal = ndecimal_step;
40+
}
41+
}
3642
double dd = e10(ndecimal);
3743
uint_t cwidth = 7;
3844
return align_left(to_string(round(dd*x0)/dd), cwidth)+" - "+

0 commit comments

Comments
 (0)