# On the precision issue of converting “real-type data to strings

**URL:** <https://community.freefem.org/t/on-the-precision-issue-of-converting-real-type-data-to-strings/4214>\
**Category:** General Discussion\
**Created:** [February 5, 2026, 9:28am UTC](https://community.freefem.org/t/on-the-precision-issue-of-converting-real-type-data-to-strings/4214 "2026-02-05T09:28:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RYP](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@RYP](https://community.freefem.org/u/RYP)\
**Post date:** [February 5, 2026, 9:28am UTC](https://community.freefem.org/t/on-the-precision-issue-of-converting-real-type-data-to-strings/4214/1 "2026-02-05T09:28:02Z")

</div>

Hello!everyone,

I’d like to manually specify the precision to be retained when converting real-type data to string data. For example：  
`string s = 20.0e6;`  
`cout << s << endl;`  
The output is `2e+07`. I’d like to get an output of `2.00e+07` and keep scientific notation.

Are there any methods for doing this?

Thank you in advance.
