
May 26th, 2004, 11:26 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 133
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
Code:
int(round(float('157.92')*100))
This is of course because there's no exact binary representation of 157.92. float('157.92') is in fact less than 157.92. This means that int() for your value will truncate it, giving you 15791.
Last edited by percivall : May 26th, 2004 at 11:30 AM.
|