-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Haworth wrote:
> I have a column defined with a type of FLOAT, which I believe is  
> treated as REAL by SQLite.  When selecting that column, I would like  
> it to be returned with a leading "$" sign and always have a decimal  
> point and two numbers after the decimal point. 

It is a spectacularly bad idea to use floating point for currency.  Numbers
that look simple to us humans such as .01 and .10 are truncated recurring
fractions in the binary representation used by the underlying hardware and
will introduce errors in your calculations.

This page helps show the details:

  http://docs.python.org/tutorial/floatingpoint.html

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkr59wgACgkQmOOfHg372QRxWACfVpaAtdRTQL6DS/vuphnZi+wu
ANYAnjnHZoOLPPfJWohRpPBYTUK8xM04
=Xbdt
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to