mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
fix: {.calc.} not working with very small numbers (because rendered with exponential syntax)
This commit is contained in:
parent
65d4a142e4
commit
26ddc2b126
@ -1962,10 +1962,7 @@ try
|
||||
begin
|
||||
try
|
||||
if isFalse(parEx('if')) then
|
||||
begin
|
||||
result:='';
|
||||
exit;
|
||||
end;
|
||||
exit('');
|
||||
except end;
|
||||
result:=md.cd.disconnectReason; // return the previous state
|
||||
if pars.count > 0 then md.cd.disconnectReason:=p;
|
||||
|
||||
@ -2576,7 +2576,8 @@ var
|
||||
i:=mImp+dir;
|
||||
repeat
|
||||
j:=i+dir;
|
||||
if (j > 0) and (j <= length(s)) and charInSet(s[j], ['0'..'9','.']) then
|
||||
if (j > 0) and (j <= length(s))
|
||||
and (charInSet(s[j], ['0'..'9','.','E']) or (j>1) and charInSet(s[j],['+','-']) and (s[j-1]='E')) then
|
||||
i:=j
|
||||
else
|
||||
break;
|
||||
@ -2606,6 +2607,7 @@ begin
|
||||
end;
|
||||
|
||||
if (i = 1) // a starting operator is not an operator
|
||||
or (s[i-1]='E') // exponential syntax
|
||||
or (v <= mImpV) // left-to-right precedence
|
||||
then continue;
|
||||
// we got a better one, record it
|
||||
|
||||
Loading…
Reference in New Issue
Block a user