Re: varchar and number

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/08/09
Message-ID: <sp42lljun4t55_at_corp.supernews.com>#1/1


"Sandy" <daleelaNOdaSPAM_at_usa.net.invalid> wrote in message news:1257c070.e32af274_at_usw-ex0109-068.remarq.com...
> hi,
>
> I have a form with two fields one for a number and for the
> decimal. I tried the character '||'to put them together in
> the same variable then it would be a number(15,2) but of
> course it doesn't work because i do like this :
>
> Price number(15,2);
> Dollar varchar2(15);
> cents varchar2(2);
>
> Price=Dollar ||','||cents;
>
> the Dollar and the cents are both in varchar2 because it is
> from the form so i can't change it.and the price is a
> variable which contains the value i will insert in a table.
> In fact, if you didn't understand if the user enter 10 for
> Dollar and 20 for cents the price would be 10,20.( If you
> did understood i apologize ).
>
> Is there a functin or anything to do it ?
>
> thanks a lot
>
> Sandy

[Quoted] On WHEN-VALIDATE-ITEM of cents, try this:

:price := nvl(to_number(:dollar),0) + (nvl(to_number(:cents),0)/100);

-Matt Received on Wed Aug 09 2000 - 00:00:00 CEST

Original text of this message