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

Re: converting receprocating currency



Hi Marybeth,

I'm not sure I understand exactly what you want to do, but
if you just want the number of digits to the left of the decimal
you can do:

let #numdigits = trunc(log10(#num)) + 1    ! Don't confuse the log10()
function with the log() function.

I believe the technical term for this number is the exponent. (??)

Cherno.

>>> "Noonan, Marybeth" <MNoonan@MFS.COM> 06/28 5:53 PM >>>
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