Measurement Problem

From: Date: Sun, 28 Mar 2004 02:55:31 +0000
Subject: Measurement Problem
Groups: php.general 
Request: Send a blank email to php-general+get-181621@lists.php.net to get a copy of this message
Hi, I am working on a PHP/MySQL solution to have a webpage where users can rate cigars. I ran into a problem though. One variable that exists is the length of the cigar. In the cigar world, the lengths are usually written like 6 1/8" or 155 mm or 4 15/16" or 125 mm. I don't want to make the length column in the database be a string with data like "6 1/8"" in it, because as the user submits cigars, different users could type it a different way, screwing up searches that are searching by length. I also want to have a real time metric conversion as well. So my question is, how should I do this? Should I have a float column with the lengths as mm and it converts it to inches? If so, then how would I convert 155.57500mm to 6 1/8", or 155mm to 6 1/8". It's hard to explain, but I can't come up with a good solution. Please ask if you need clarification. Any help is much appreciated! Thanks! Karl

« previous php.general (#181621) next »