[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: converting receprocating currency



MaryBeth,

How about:

let #num_digits = length(edit(#num,'8999999'))

I was going to include trunc(), but the edit mask itself should eliminate the
decimal portion - the 8 at the beginning will left-justify the result.

HTH,
Denise White
Sr. Programmer/Analyst
Vicor

------------------------------

Date:    Wed, 28 Jun 2000 16:53:56 -0400
From:    "Noonan, Marybeth" <MNoonan@MFS.COM>
Subject: converting receprocating currency

Hi,
Oracle 8.05, SQR 4.2.2 ,Ptools 7.54, PS APPS 7.52
I am loading currency rates into PS (we do not have treasury module) so I am
doing w/SQR I have created a flat file from anothe DB non PS that has the
USD to Foreign Currency Conversion.  Now I need to convert the inverse of
these rates.
The currency rate is numberic 9999999.99999999
FLat FIle has this   i.e USD to BRL   1.8220000
                                            USD to CAD     1.4818000
                                           USD to HKD     7.7938000
                                            USD to JPY    105.5100020
Now if  I divide 1 into these amounts I get correct conversion if  the
integer portion to left of decimal is 1 position otherwise I need to do a
2nd calculation eg., USD to JPY ..Divide 1 into 105.5100020 * .001  This
last number depends on the number of significant digits to left of decimal.

My question , Is there a function to get the number of significant  digits
(omit leading zeros)to left of decimal point so that I know what to muliply
by if conversion rate is greater than  9.99999999 , 99.99999999,
999.99999999 etc.

As always, Thanks for any suggestions
MaryBeth Noonan
Financial Systems
Ext.  57467
mnoonan@mfs.com