Babel Django Off By 1 Cent

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-06-15T02:19:38Z Indexed on 2010/06/15 2:22 UTC
Read the original article Hit count: 273

Filed under:
|
|

I ran into a problem today while using BabelDjango and thought I would ask if anyone has ran into anything similar. I was using the tags in my templates, {% load babel %} and then {{amount_owed|currencyfmt:"USD"}} which returned the amount_owed minus one-cent.

I thought maybe the returned value was 9.949999 which should still be $9.95 but when I returned the raw value it returned "9.95". However when I formatted it using the babel tags the rsult was off by one-cent. My 9.95 returned "$9.94"

Anyone have any advice where to look to troubleshoot this problem?

Thanks in advance for your help.

© Stack Overflow or respective owner

Related posts about django

Related posts about templates