You've already forked lazarus-ccr
LazStats: Accept both decimal separators in the sub-menu forms of "Simulations" > "Probabilities"
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8048 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -46,6 +46,7 @@ function FactorialLn(n: Integer): Double;
|
||||
function PoissonPDF(n: integer; a: double): Double;
|
||||
function PoissonCDF(n: Integer; a: double): Double;
|
||||
|
||||
function MyTryStrToFloat(S: String; out AValue: Double): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -569,6 +570,20 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{ Converts a string to a floating point value. Checks for comma or point as
|
||||
decimal separator }
|
||||
function MyTryStrToFloat(S: String; out AValue: Double): Boolean;
|
||||
var
|
||||
fs: TFormatSettings;
|
||||
begin
|
||||
Result := TryStrToFloat(S, AValue);
|
||||
if not Result then
|
||||
begin
|
||||
fs := FormatSettings;
|
||||
if fs.DecimalSeparator = '.' then fs.DecimalSeparator := ',' else fs.DecimalSeparator := '.';
|
||||
Result := TryStrToFloat(S, AValue, fs);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
InitFactLn();
|
||||
|
Reference in New Issue
Block a user