# Scientific notation formatting

**URL:** <https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565>\
**Category:** Help\
**Created:** [September 26, 2023, 6:01pm UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565 "2023-09-26T18:01:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![garynewport](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@garynewport](https://fortran-lang.discourse.group/u/garynewport)\
**Post date:** [September 26, 2023, 6:01pm UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565/1 "2023-09-26T18:01:56Z")

</div>

I have a value that I am displaying and it is appearing as 0.9944E+32

I have it set as

write(6, “(e13.4)”) corm

Where corm is holding a double precision value.

I’d like it to be displayed as:

9.9437E+32

However, increasing the 4 to 5 or the 13 does nothing.

Is this simple to do using just a standard format?

---

<div class="post-metadata">

**Author:** ![FedericoPerini](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/federicoperini/32/1750_2.png) [@FedericoPerini](https://fortran-lang.discourse.group/u/FedericoPerini)\
**Post date:** [September 26, 2023, 6:38pm UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565/2 "2023-09-26T18:38:26Z")

</div>

> [@garynewport](#):
>
> r, increasing the 4 to 5 or th

One thing you could do is to shift the decimal point by 1 digit (`1p`):

```auto
write(6, “(1pe13.4)”) corm

```

NOTE! non-trivially, the `1p` addition will stick through the end of the format statement (i.e., if you have following numbers, it will also apply to them until you reset it say with `0p` somewhere next). So, please handle with care…

---

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [September 26, 2023, 7:06pm UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565/3 "2023-09-26T19:06:50Z")

</div>

> [@FedericoPerini](#):
>
> One thing you could do is to shift the decimal point by 1 digit (`1p`):

That was the answer with f77. With modern fortran, a better approach would be to use an `es13.4` or maybe an `es0.4` format.

---

<div class="post-metadata">

**Author:** ![DavidB](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@DavidB](https://fortran-lang.discourse.group/u/DavidB)\
**Post date:** [September 27, 2023, 1:29am UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565/4 "2023-09-27T01:29:03Z")

</div>

See - for example - [https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-2/es-editing.html](https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-2/es-editing.html)

On output, the ES data edit descriptor transfers the real value of the corresponding I/O list item, right-justified and rounded to d decimal positions, to an external field that is w characters long if w is positive. The real value is output in scientific notation, where the absolute value of the significand is greater than or equal to 1 and less than 10 (unless the output value is zero).

---

<div class="post-metadata">

**Author:** ![garynewport](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@garynewport](https://fortran-lang.discourse.group/u/garynewport)\
**Post date:** [September 27, 2023, 6:47pm UTC](https://fortran-lang.discourse.group/t/scientific-notation-formatting/6565/5 "2023-09-27T18:47:35Z")

</div>

Perfect; thank you!
