[NumPy-Tickets] [NumPy] #1575: format gives ValueError when passed float32

NumPy Trac numpy-tickets@scipy....
Sun Aug 8 21:25:57 CDT 2010

#1575: format gives ValueError when passed float32
 Reporter:  crm             |       Owner:  somebody
     Type:  defect          |      Status:  new     
 Priority:  normal          |   Milestone:          
Component:  numpy.core      |     Version:  1.4.0   
 Keywords:  format float32  |  
 Passing a float32 to the inbuilt format function returns a value error:

 >>> format(np.float32(1.23),'.1f')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ValueError: Unknown format code 'f' for object of type 'str'

 float64 works as expected:
 >>> format(np.float64(1.23),'.1f')

 python version: 2.6.5[[BR]]
 numpy version: 1.4.1[[BR]]
 OS: WindowsXP

Ticket URL: <http://projects.scipy.org/numpy/ticket/1575>
NumPy <http://projects.scipy.org/numpy>
My example project

More information about the NumPy-Tickets mailing list