Post Reply 
Number format Input instruction
06-30-2015, 07:19 AM
Post: #6
RE: Number format Input instruction
Hi Tim and Didier,
Quote:Maybe you can give a program example showing the issue you're reporting.
See my next very simple prgram.
For this prgram "engineering" format is not necessary, just used as an example.

Code:

LOCAL Old, New, Chg,
      Total, Part, Proc;

EXPORT Percent
BEGIN
LOCAL C1,C2,C3,C4,C5,C6;
LOCAL T1,T2;
LOCAL IN:=1;
T1:=HFormat; T2:=HDigits;
HFormat:=3;  HDigits:=4;

WHILE IN=1 DO

IN:=INPUT(
{{Old,[0],{30,40,0}},
 {New,[0],{30,40,1}},
 {Chg,[0],{30,40,2}},
 {C1,3,{80,1,0}},
 {C2,3,{80,1,1}},
 {C3,3,{80,1,2}},
 {Total,[0],{30,40,4}},
 {Part,[0],{30,40,5}},
 {Proc,[0],{30,40,6}},
 {C4,3,{80,1,4}},
 {C5,3,{80,1,5}},
 {C6,3,{80,1,6}}},
 "Percent",
 {"Old: ","New: ","%Diff: ",
  "","","",
  "Total: ","Part: ","%Total: ",
  "","",""});

IF IN=0 THEN
   HFormat:=T1; HDigits:=T2;
   KILL;
END;

IF C1>0 THEN
   Old:=100*New/(Chg+100);
   C1:=0;
END;

IF C2>0 THEN
   New:=(Chg*Old+100*Old)/100;
   C2:=0;
END;

IF C3>0 AND Old≠0 THEN
   Chg:=100*(New-Old)/Old;
   C3:=0;
END;

IF C4>0 AND Proc≠0 THEN
   Total:=100*Part/Proc;
   C4:=0;
END;

IF C5>0 THEN
   Part:=Proc*Total/100;
   C5:=0;
END;

IF C6>0 AND Total≠0 THEN
   Proc:=100*Part/Total;
   C6:=0;
END;

END; //WHILE
END; //BEGIN

Run this program.
All values are zero -> "standard" format presentation, not correct.
Enter the first value, for instance 1 <OK> -> display = 1.0000E0, correct.
Enter the second value, for instance 2 <OK> -> display = 2.0000E0, correct.
Check the checkbox after the third value.
Select <OK> to calculate.
After that all values are again presentated in "standard" format, that's not correct.
Must be "engineering" format.
Close the program with <Cancel>.

— Dirk Hartland
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Number format Input instruction - Dirk.nl - 06-27-2015, 12:42 PM
RE: Number format Input instruction - Dirk.nl - 06-30-2015 07:19 AM



User(s) browsing this thread: 1 Guest(s)