Home » Developer & Programmer » Forms » time problem
time problem [message #78629] Wed, 06 March 2002 04:35 Go to next message
My cursor Pratap to clari
Messages: 1
Registered: March 2002
Junior Member
function CF_1Formula return number is

v_time number(4,2) := null;

cursor get_time is
select :hrs + to_number(to_char(trunc(:mins/60)) ||'.'||to_char(mod(:mins,60)))
from dual;

begin

if :mins > 59 then
open get_time;
fetch get_time into v_time;
close get_time;
return (to_char(v_time,'99.99'));
else
v_time := to_char(nvl(:hrs,0))||'.'||to_char(nvl(:mins,0));
return (v_time);
end if;

end;

---------
/* so 1. hrs = 1 mins = 30 result 1.3 (wrong)
2. hrs = 2 mins = 64 result 3.4 (correct)
3. hrs = 0 mins = 50 result .5 (wrong) */

hope this makes things clearer!

Regards,
Nik.
Re: time problem [message #78631 is a reply to message #78629] Wed, 06 March 2002 05:39 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
set the format mask 99.99
Previous Topic: Problem with text item of forms 6 Immediate help reqd
Next Topic: nearly there, but not quite Pratap, not sure what is happening
Goto Forum:
  


Current Time: Fri Mar 29 09:12:03 CDT 2024