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

NumPy Trac numpy-tickets@scipy....
Wed Nov 16 08:15:09 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 charris):

 This looks to have been fixed. With current master and Python 2.7.2


 {{{
 In [1]: 'hello {:.1f}'.format(np.float32(1.39))
 Out[1]: 'hello 1.4'

 In [2]: 'hello {:.1f}'.format(np.float64(1.39))
 Out[2]: 'hello 1.4'

 In [3]: 'hello {:.1f}'.format(np.float16(1.39))
 Out[3]: 'hello 1.4'
 }}}

 I expect things should work for the 1.6.x release also, but I haven't
 tested it.

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


More information about the NumPy-Tickets mailing list