Bug 15583

Summary: Formatting is missing a space in specific situations
Product: R Reporter: Ricardo Saporta <saporta>
Component: I/OAssignee: R-core <R-core>
Status: CLOSED FIXED    
Severity: minor CC: murdoch
Priority: P5    
Version: R 3.0.2   
Hardware: All   
OS: All   

Description Ricardo Saporta 2013-11-30 05:53:49 UTC
Notice that in the first example below, there is a space missing between 
5623.41 and 10000.00

In other scenarios, there is no such missing space

> 1000* ((10^(1/4)) ^ c(0:4))
[1] 1000.00 1778.28 3162.28 5623.4110000.00

> 1000* ((10^(1/3)) ^ c(0:3))
[1]  1000.00  2154.43  4641.59 10000.00

> 1000* ((10^(1/4)) ^ c(0:5))
[1]  1000.00  1778.28  3162.28  5623.41 10000.00 17782.79
Comment 1 Ricardo Saporta 2013-11-30 05:55:10 UTC
I submitted this as a Mac Gui issue, but then tested in Terminal and observed the same issue.
Comment 2 Brian Ripley 2013-12-06 07:45:12 UTC
Simpler example:

7/0.07

Both new in 3.0.2.
Comment 3 Duncan Murdoch 2013-12-06 19:35:30 UTC
This is related to the fix to PR#15411:  in that case, extra spaces were added.
We were too aggressive in removing them.  (The underlying reason for adding the spaces was that scientific format may do more rounding than fixed format:  on numbers like 9996 with 3 digit accuracy, scientific gives 1e+04, fixed gives 9996.  But in your examples both do the rounding, so we shouldn't compensate for it.)

I will commit a fix shortly.