Fw: double(3,2) behaving oddly on WinXP?
am 21.10.2005 14:46:48 von SGreen--=_alternative 00463198852570A1_=
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Sorry - forgot to add the list to my direct response....
----- Forwarded by Shawn Green/Unimin on 10/21/2005 08:46 AM -----
Shawn Green/Unimin wrote on 10/21/2005 08:43:47 AM:
> "David Rayner"
>=20
> > Shawn,
> > Having reread the doc I agree but I am bewildered, because this is=20
> > on a website that I designed and has been working for a=20
> > year selling =A3000's of product every day! On which there is no=20
> > product worth less that =A310.00 ??!!??
> > >=20
> > > That is correct behavior. The definition double(3,2) means you can=20
only=20
> > > have 3 digits, two of which are behind the decimal. The numbers must =
> > > meet the pattern #.##. The definition double(5,2) has 5 digits two=20
of=20
> > > which are behind the decimal point. That means that all numbers must =
fit=20
> > > the pattern ###.##. If you try to insert a number into a field that=20
> > > exceeds the limits of the field, MySQL substitutes with the largest=20
> > > value that fits the field or raises an error (depending on which=20
> > > SQL=5FMODE you are using).=20
> > >=20
> > > Trying to add the number 1000 to a field defined as (5,3) would=20
result=20
> > > in 999.99 because 1000 would need four digits in front of the=20
decimal.=20
> > >=20
> > > Make sense?=20
> > >=20
> > > Shawn Green
> > > Database Administrator
> > > Unimin Corporation - Spruce Pine=20
> >=20
> >=20
> > --=20
> > Best Regards
> > David Rayner MSc CEng
> > "Ergo bibamus!"=20
> >=20
> The older implementation was broken. Previously, if you defined a=20
> (3,2) field you actually got (4,2) for positive numbers and (3,2)=20
> for negative numbers because the space used for the sign was not=20
> being reserved correctly. That's why, on older versions, a field=20
> definition of (3,2) could hold 4 digits if you were displaying a=20
> positive number... make sense?
>=20
> I am sorry this bug (the broken previous versions) bit you once they
> fixed the inconsistent behavior.
>=20
> BTW - does your tag line translate as "that's why we drink"? My=20
> Latin is a bit rusty.... ;-)
>=20
> Shawn Green
> Database Administrator
> Unimin Corporation - Spruce Pine
--=_alternative 00463198852570A1_=--