note 70775 added to ref.math

From: Date: Fri, 27 Oct 2006 12:51:04 +0000
Subject: note 70775 added to ref.math
Groups: php.notes 
Request: Send a blank email to php-notes+get-119182@lists.php.net to get a copy of this message
In Evan's ordinal function, the line: <?php $tens = substr($cardinal, -2, 1); ?> needs to be replaced by: <?php $tens = round($cardinal/10); ?> or similar. At least on PHP 4.3.10, substr("1", -2, 1) returns '1' - so Evan's function gives "1th", as well as "11th". This is contrary to the documentation, but is noted in the comments on the substr manual page. ---- Server IP: 83.138.144.80 Probable Submitter: 81.149.16.181 ---- Manual Page -- http://www.php.net/manual/en/ref.math.php Edit -- https://master.php.net/note/edit/70775 Del: integrated -- https://master.php.net/note/delete/70775/integrated Del: useless -- https://master.php.net/note/delete/70775/useless Del: bad code -- https://master.php.net/note/delete/70775/bad+code Del: spam -- https://master.php.net/note/delete/70775/spam Del: non-english -- https://master.php.net/note/delete/70775/non-english Del: in docs -- https://master.php.net/note/delete/70775/in+docs Del: other reasons-- https://master.php.net/note/delete/70775 Reject -- https://master.php.net/note/reject/70775 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#119182) next »