note 44692 added to language.types.float

From: Date: Fri, 13 Aug 2004 01:36:26 +0000
Subject: note 44692 added to language.types.float
Groups: php.notes 
Request: Send a blank email to php-notes+get-74571@lists.php.net to get a copy of this message
General computing hint: If you're keeping track of money, do yourself and your users the favor of handling everything internally in cents and do as much math as you can in integers. Store values in cents if at all possible. Add and subtract in cents. At every operation that wii involve floats, ask yourself "what will happen in the real world if I get a fraction of a cent here" and if the answer is that this operation will generate a transaction in integer cents, do not try to carry fictional fractional accuracy that will only screw things up later. ---- Manual Page -- http://www.php.net/manual/en/language.types.float.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44692 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44692&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44692&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74571) next »