At 05:45 10.11.2002, Michael P. Carel said: --------------------[snip]-------------------- >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 . --------------------[snip]--------------------
<?php $in = '1/2'; eval("\$out = (double)$in;"); echo "$in = $out\n"; ?> Needs a lot of work before and after to check if things are right, but I believe you get the idea... -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php