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

NumPy Trac numpy-tickets@scipy....
Tue Nov 15 21:40:28 CST 2011


#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  |  
----------------------------+-----------------------------------------------

Comment(by pfctdayelise):

 hmm.... unexpectedly using the old-style "%" formatting works:

 >>> 'hello %.1f' % (1.39)
 'hello 1.4'

 >>> 'hello %.1f' % (np.float64(1.39))
 'hello 1.4'

 >>> 'hello %.1f' % (np.float32(1.39))
 'hello 1.4'

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


More information about the NumPy-Tickets mailing list