Bug in doubleToString (?)


#1

When converting doubles to a String and requesting a specific number of decimals, the code appear to be entirely platform independent,
so this bug should show up everywhere. For example, how does the following String look:

String cSayWhat(803893.68080668431, 15);

That is one wacky smiley!


#2

Damn! Thanks, fixed now!


#3

Great, thanks :slight_smile:

Footnote; the bug was found in 2.0.27. Anyone using a later version should probably not see it.


#4

I also noticed a big performance lack if I do this conversion on Windows 7.
Mac was fine but then I switched to Windows and had this issue.

Could it have something to do with this?


#5

[quote=“Joerg Koehler”]I also noticed a big performance lack if I do this conversion on Windows 7.
Mac was fine but then I switched to Windows and had this issue.

Could it have something to do with this?[/quote]

Can’t think why there’d be a performance issue… If there’s a difference on Windows then it’s probably something to do with MS’s sprintf implementation.


#6

Just double checked but can’t reproduce anymore.
Was a while ago when i noticed that and if my brain serves me well,
it only happened when I skip passing numberOfDecimalPlaces.

Anyway, can’t reproduce it anymore.