Hi Trying to format a 4 cahrachter text field to time. The code is bwlow:
Local StringVar AMPM := "";
Local StringVar HR := "";
Local NumberVar NHR := 0;
IF LEFT({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},2) >= "12" THEN
AMPM := "PM"
ELSE AMPM := "AM";
NHR := tonumber(LEFT({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},2));
IF NHR >= 13 THEN
NHR := NHR - 12;
HR := totext(truncate(NHR));
HR+":"+MID({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},3,2)+" "+AMPM;
The problem is that the HR desplays as (9.00) for example; with two decimal digits.
How can we get rid of the (.00) from the HR field.
Thanks a lto.
Mo
Local StringVar AMPM := "";
Local StringVar HR := "";
Local NumberVar NHR := 0;
IF LEFT({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},2) >= "12" THEN
AMPM := "PM"
ELSE AMPM := "AM";
NHR := tonumber(LEFT({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},2));
IF NHR >= 13 THEN
NHR := NHR - 12;
HR := totext(truncate(NHR));
HR+":"+MID({ENCV_SCHEDULEBYRESOURCE.KEY_TIME},3,2)+" "+AMPM;
The problem is that the HR desplays as (9.00) for example; with two decimal digits.
How can we get rid of the (.00) from the HR field.
Thanks a lto.
Mo