```
struct reqs {
std::string n_name;
std::string units;
std::string amt_grams;
std::string amt_pct;
};
```

I the do a pushback of this structure into a std::vector of type <reqs>

```
std::vector<reqs> rvector;
```

I print this vector out using qDebug in a loop from from 0 to < rvector.size().

The numbers that are 1,000,000 or larger print in scientific notation 1e6.

When I try to do math operations on these numbers they are ALWAYS off by a factor of 1000.

I think that the exponent cannot be interpreted correctly.

I've made separate vectors for each item in the structure of type <double> and parsed through

the rvector loading each vector using this conversion to float

```
double tmpdbl = (double)atof(rvector[i].units.c_str());
req_units_vector.push_back(tmpdbl);
```

Still when I try to display using qDebug or std::cout I get exponents and get the same bogus division result which is off

by 1000.

Any suggestions on getting ONLY doubles and no exponent representation.

]]>```
struct reqs {
std::string n_name;
std::string units;
std::string amt_grams;
std::string amt_pct;
};
```

I the do a pushback of this structure into a std::vector of type <reqs>

```
std::vector<reqs> rvector;
```

I print this vector out using qDebug in a loop from from 0 to < rvector.size().

The numbers that are 1,000,000 or larger print in scientific notation 1e6.

When I try to do math operations on these numbers they are ALWAYS off by a factor of 1000.

I think that the exponent cannot be interpreted correctly.

I've made separate vectors for each item in the structure of type <double> and parsed through

the rvector loading each vector using this conversion to float

```
double tmpdbl = (double)atof(rvector[i].units.c_str());
req_units_vector.push_back(tmpdbl);
```

Still when I try to display using qDebug or std::cout I get exponents and get the same bogus division result which is off

by 1000.

Any suggestions on getting ONLY doubles and no exponent representation.

]]>Since you have strings why not use stof ?

It has the advantage of screaming at you if there's an issue during the conversion.

]]>@SGaist suggests using

`stof`

. Since you say you are storing the numbers as `double`

s not `float`

s, why not use the underlying strtod or the corresponding stod, rather than gratuitously discarding the extra precision?
Note that the "exponent representation" is produced on *output*. `qDebug()`

uses the default floating point output, which goes to exponent for small/large values, as well as limiting to 6 significant digits. You can change that to e.g. never use exponent via, say, `qDebug() << QString::number(doubleNum, 'f', 12)`

, https://doc.qt.io/qt-5/qstring.html#number-6.

But when I put the numbers into a qtablewidget item they also are exponential.

At some point you want to call `QString::number(doubleNum, 'f', 12)`

. That could be when storing them as strings, or in a `QStyledItemDelegate`

for output. This is just for the issue of displaying them.