# How to read D exponential notation

**URL:** <https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175>\
**Category:** Newbie\
**Created:** [August 12, 2022, 4:44pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175 "2022-08-12T16:44:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robygru](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@robygru](https://root-forum.cern.ch/u/robygru)\
**Post date:** [August 12, 2022, 4:44pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175/1 "2022-08-12T16:44:43Z")

</div>

Hi! i’ve a problem reading an external file in D+ exponential notation on root. Are there some tips to convert in E+ or have I to do manually from txt editor?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 12, 2022, 5:50pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175/2 "2022-08-12T17:50:24Z")

</div>

You could read these values as strings, change “D” into “E” and then use [`std::stod`](https://cplusplus.com/reference/string/stod/) or [`atof`](https://cplusplus.com/reference/cstdlib/atof/).

---

<div class="post-metadata">

**Author:** ![robygru](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@robygru](https://root-forum.cern.ch/u/robygru)\
**Post date:** [August 12, 2022, 6:00pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175/3 "2022-08-12T18:00:33Z")

</div>

i don’t know how to do this. I read a file in TGraph selecting the columns I want to graph (with %\*lg and so on) and i don’t know if is possible to change the exp notation from D to E at this point.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 12, 2022, 6:07pm UTC](https://root-forum.cern.ch/t/how-to-read-d-exponential-notation/51175/4 "2022-08-12T18:07:21Z")

</div>

In this case, it’s better to fix it in the data file (e.g., you can use “[sed](https://www.gnu.org/software/sed/manual/sed.html)”),

Actually, I once reported a similar problem: [TTree::ReadFile problems with CSV files](https://sft.its.cern.ch/jira/browse/ROOT-10867)
