Hi,
I am using Oracle Database 11GR2. I have written a simple PL/SQL block that is validating as false. Basically trying to ensure that FX calculation is correct to 4 decimal places.
So example,
1.000 vs 1.0000 should evaluate to false
1.0000 vs 1.0000 should evaluate to true
For this purpose, I am doing string comparison. I am not sure why the below code is evaluating to "false", or what is the proper way to do such comparison in PL/SQL?
declare
l_fx_rate varchar2(100) := to_char(1, '9999.9999');
l_aud_usd varchar2(100) := to_char((23/23),'999999.9999');
BEGIN
htp.p(l_fx_rate);
htp.p(l_aud_usd);
IF l_fx_rate = l_aud_usd
THEN
htp.p('true');
else
htp.p('false');
END IF;
END;
Thanks.