Re: converting decimal to fraction and vice versa
| From: | Jason Wong | Date: | Sun, 10 Nov 2002 07:57:11 +0000 |
| Subject: | Re: converting decimal to fraction and vice versa | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123665@lists.php.net to get a copy of this message | ||
On Sunday 10 November 2002 12:45, Michael P. Carel wrote:
> hi to all;
>
> is there any way to convert decimal numbers to fraction and fraction to
> decimal format. i need to convert the inputed fractional value in the field
> before inserting it to the mysql database, such us 1/2 = 0.5 . thanx in
> advance.
Short answer: Yes.
Longer answer: No, not with the built-in functions.
Longest answer: You'll have to write your own functions/class, or find some
existing ones -> www.hotscripts.com, www.phpclasses.org, www.zend.com etc.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
"Card readers? We don't need no stinking card readers."
-- Peter da Silva (at the National Academy of Sciencies, 1965, in a
particularly vivid fantasy)
*/