List:General Discussion« Previous MessageNext Message »
From:Madscientist Date:September 20 2002 12:26pm
Subject:RE: Fractions
View as plain text  
You might also consider using two integer type fields - one for the
numerator and another for the denominator. This way storage and recovery are
easy and the mathematics are wide open.
_M

]-----Original Message-----
]From: MySQL [mailto:mysql@stripped]
]Sent: Thursday, September 19, 2002 7:51 PM
]To: mysql@stripped
]Cc: wmartell@stripped; win32@stripped
]Subject: Re: Fractions
]
]
]   Mailing-List: contact mysql-help@stripped; run by ezmlm
](http://www.ezmlm.org)
]   X-Sender: paul@stripped@teton.kitebird.com
]   Date: Thu, 19 Sep 2002 08:54:55 -0500
]   From: Paul DuBois <paul@stripped>
]   News-Group: list.mysql
]   Reply-To: <mysql@stripped>
]
]   At 20:47 -0500 9/18/02, William Martell wrote:
]   >Hello.
]   >
]   >Can anyone tell me whether we can represent fractions in MySQL
]4.0.  I have
]   >data representing different lengths of objects measured in
]inches.  Can I
]   >load this data as is into a field in MySQL or do I have to
]convert it first
]   >into an floating point interger or decimal value???
]
]   You could store them as strings, but you'd have to interpret them on
]   the client side, most likely.
]
]In which case you might as well store them as reals, with char
]substitution (interpret).  As reals, later when the inevitable desire
]occurs to add different lengths, it will be simple.
]
]---------------------------------------------------------------------
]Before posting, please check:
]   http://www.mysql.com/manual.php   (the manual)
]   http://lists.mysql.com/           (the list archive)
]
]To request this thread, e-mail <mysql-thread120108@stripped>
]To unsubscribe, e-mail
]<mysql-unsubscribe-madscientist=microneil.com@stripped>
]Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
]
]

Thread
FractionsWilliam Martell19 Sep
  • Re: FractionsPaul DuBois19 Sep
    • Re: FractionsMySQL20 Sep
      • RE: FractionsMadscientist20 Sep
        • Re: FractionsMySQL21 Sep
        • Re: FractionsMichael T. Babcock23 Sep
  • Re: FractionsThomas Spahni19 Sep
Re: FractionsMichael T. Babcock19 Sep
Re: FractionsJan Steinman22 Sep