Re[2]: [PHP] numeric to word function
| From: | Tom Rogers | Date: | Fri, 13 Sep 2002 10:16:47 +0000 |
| Subject: | Re[2]: [PHP] numeric to word function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116252@lists.php.net to get a copy of this message | ||
Hi,needs 1 more change
Friday, September 13, 2002, 6:26:10 PM, you wrote:
TR> else{
TR> $res = $res%10;
TR> if($res > 0){
TR> ($left == 0)? $and = '':$and = ' and ';
TR> $t = $this->words[0][$res]. " hundred".$and.$t;
TR> }
TR> else{
TR> if($left > 0)$t = ' and '.$t;
TR> }
TR> $num = intval($num/1000);
>>>>>> $this->num($num);
TR> }
TR> return $t;
TR> }
TR> }
TR> //usage
TR> $n2t = new num_to_text();
TR> for($num = 0;$num < 1102;$num++){
TR> echo $num.' '.$n2t->convert($num).'<br>';
TR> }
TR> --
TR> regards,
TR> Tom
--
regards,
Tom