Skip to content

Commit 2b990fc

Browse files
James BarbettiJames Barbetti
James Barbetti
authored and
James Barbetti
committed
formatPositiveNumber() now lets scientific-notation numbers go through untouched.
1 parent 3cef95a commit 2b990fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

starttree.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "starttree.h"
2121
#include <iostream> //for std::cout
2222
#include <sstream> //for std::stringstream
23+
#include <utils/stringfunctions.h> //for contains
2324

2425
namespace StartTree {
2526

@@ -216,6 +217,11 @@ namespace {
216217
s.precision( (w>=2) ? (w-2) : 0);
217218
s << n;
218219
std::string t = s.str();
220+
221+
if (contains(t,"e")) {
222+
return t;
223+
}
224+
219225
if (1.0 <= n ) {
220226
if ( t.length() < (size_t)w ) {
221227
return std::string(w-t.length(), ' ') + t;

0 commit comments

Comments
 (0)