Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP ABOUT REMAINDER IN PL/SQL

Re: HELP ABOUT REMAINDER IN PL/SQL

From: <prince_kumar_at_my-deja.com>
Date: Fri, 17 Nov 2000 22:41:51 GMT
Message-ID: <8v4c7d$bfm$1@nnrp1.deja.com>

You may write a function with the sql stmt like the following one

select decode(trunc(<myVar>/1000000),0,null,to_Char(to_date(trunc (<myVar>/1000000),'J'),'Jsp') ||' Million ') || decode( <myVar>- trunc(<myVar>/1000000) * 1000000, 0, ' Zero',

        to_char(to_date(<myVar>- (trunc(<myVar>/1000000) *1000000),'J'),'Jsp') ) from dual

Note: this will work only if, the number digits are less than or equal to nine. u may have to chage the stmt if the number of digits are more than 9 and if there will be any decimals

Regards,
Prince.

In article <gt4R5.53008$4U6.2268663_at_news1.rdc2.on.home.com>,   "Andrew Huy Truong" <andrew-htruong_at_home.com> wrote:
> Hi, I have a problem here hoping someone could help me out, I'll be
 very
> much appreciated.
> I need to know the symbol for a REMAINDER of a number, for example, 5
 divide
> by 2, then the remainder would be 1. Or if 8 divide 3 then the
 remainder
> would be 2 and so on...
> I know in C language the symbol is %.
> like 5 % 2;
> I'd like to know this symbol for PL/SQL or SQL plus, or if you can
 let me
> know the formula that would calculate the same result.
>
> Thanks a bunch.
> my email is andrew-htruong_at_home.com
> Andrew.
>
> I am doing this assignment for a class and I required to:
>
> write a function convert_into_words tht takes in number value and
 returns
> the same number into words (take number from 1 to 99) for example: if
 1 is
> passed then 'one' is returned, or 5 is passed, then 'five' is
 returned.
>
> I cannot use any bulit in function.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Nov 17 2000 - 16:41:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US