Re: select decimal column from mysql

john miky <[email protected]> Mon, 20 Dec 2021 14:19:06 +0800
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <CACbameH9kt==mziXUutHAvAyi7fgsre=eFbjpOJJP+_r8dm3Tw@mail.gmail.com>
--00000000000051ace705d38dde31
Content-Type: text/plain; charset="UTF-8"

hmm. it is perl's "problem", not dbi.

On Mon, Dec 20, 2021 at 1:20 PM john miky <[email protected]> wrote:

> hi,
>
> I select a decimal column, from mysql with dbi,
> the value 0.015 for example,  my ($v) = $dbh->selectrow_array("select
> price from test limit 1")
> it is greater than 0 in perl.
>
> What's the proper way to get a float value ?
>

--00000000000051ace705d38dde31
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">hmm. it is perl&#39;s &quot;problem&quot;, not dbi.<br></d=
iv><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On =
Mon, Dec 20, 2021 at 1:20 PM john miky &lt;<a href=3D"mailto:[email protected]=
om">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div>hi,</div><div><br></div><div>I se=
lect a decimal column, from mysql with dbi,</div><div>the value 0.015 for e=
xample,=C2=A0 my ($v) =3D $dbh-&gt;selectrow_array(&quot;select price from =
test limit 1&quot;)<br></div><div>it is greater than 0 in perl.</div><div><=
br></div><div>What&#39;s the proper way to get a float value ?<br></div></d=
iv>
</blockquote></div>

--00000000000051ace705d38dde31--