possible to round number and convert to string?
Dr. Phillip M. Feldman
pfeldman at verizon.net
Sat Aug 1 00:17:56 CEST 2009
I'd like to be able to convert a float to a string representation in which
the number is rounded to a specified number of digits. If num2str is a
hypothetical function that does this, then num2str(pi,3) would be '3.142'
(not '3.141'). I've been told that there is no such function in Python. I
tried to write this myself, but wasn't successful. Any suggestions will be
View this message in context: http://www.nabble.com/possible-to-round-number-and-convert-to-string--tp24763821p24763821.html
Sent from the Python - python-list mailing list archive at Nabble.com.
More information about the Python-list