# Convert a float into a string

**URL:** <https://discourse.julialang.org/t/convert-a-float-into-a-string/49513>\
**Category:** Numerics\
**Created:** [November 3, 2020, 10:01am UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513 "2020-11-03T10:01:45Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 3, 2020, 6:58pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/21 "2020-11-03T18:58:28Z")

</div>

OK, this just seems so terribly horribly inefficient, I cannot help trying to push for more explanation. I get physically unwell when I see people doing numerical calculations by converting to strings 😉

---

<div class="post-metadata">

**Author:** ![teriiju](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/teriiju/32/19029_2.png) [@teriiju](https://discourse.julialang.org/u/teriiju)\
**Post date:** [November 3, 2020, 7:01pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/22 "2020-11-03T19:01:08Z")

</div>

Guys,  
as mentioned on rep #5, I already have some way to do this.  
the purpose is actually to avoid converting to string : though “chop” does not give us the option to do so, so beside i’m now looking into remdiv() as a more efficient way to get whats needed.  
(with or without string conv…)  
Thanks to all !

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [November 3, 2020, 7:21pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/23 "2020-11-03T19:21:38Z")

</div>

Glad you’re making progress! From experience, on this forum it is most useful and efficient to state the exact problem you want to solve. In this case, if your end-goal was to end up with numbers as strings, great! But it seems like that wasn’t the case, and the whole procedure ended up taking a different turn…

This post (and your other one about divrem) seem like a case of the [XY problem](https://en.wikipedia.org/wiki/XY_problem). So it’s best to just as for what you really want, rather than what you think will take you further on the path to what you really want.

Just my two cents!

---

<div class="post-metadata">

**Author:** ![teriiju](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/teriiju/32/19029_2.png) [@teriiju](https://discourse.julialang.org/u/teriiju)\
**Post date:** [November 3, 2020, 7:27pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/24 "2020-11-03T19:27:53Z")

</div>

the post #5 discribed it fully. at the time I didnt know if remdiv was even going to be usefull, and didnt want to mix both function usage in the same post.  
remdiv just appears to be a lil bit faster now, still, though i havent chopped the 2nd param (remainer) which is what is left to be done…and might involve…again, string convertion !  
so its too soon - for me - to come to a conclusion about that  
…my 2,5 cents !  
🙂

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [November 3, 2020, 10:09pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/25 "2020-11-03T22:09:18Z")

</div>

Ok, well I’m happy I was able to help!

> [@teriiju](#):
>
> remdiv just appears to be a lil bit faster now, still, though i havent chopped the 2nd param (remainer) which is what is left to be done…and might involve…again, string convertion !

There is pretty much _never_ a reason to do any number manipulations through strings, so I quite hope you find another way…

---

<div class="post-metadata">

**Author:** ![teriiju](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/teriiju/32/19029_2.png) [@teriiju](https://discourse.julialang.org/u/teriiju)\
**Post date:** [November 3, 2020, 10:26pm UTC](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513/26 "2020-11-03T22:26:00Z")

</div>

True, I’ve read quite some remarks about why not doing so recently, actually, its quite a surprise to see such a distinction between strings and numbers (starting with their use in functions)… but thats how it works so far …

[Previous page](https://discourse.julialang.org/t/convert-a-float-into-a-string/49513.md?page=1)
