View Issue Details

IDProjectCategoryView StatusLast Update
0006748JEDI VCL00 JVCL Componentspublic2022-05-04 15:35
ReporteracgubamgAssigned To 
PrioritynormalSeverityblockReproducibilityalways
Status newResolutionopen 
PlatformAlexandria 11.1OSWindowsOS Version10
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0006748: JvBaseEdits, IsValidFloat
Descriptiona failure occurs in TJVDBCalcEdit, when trying to type a value starting as cents, without typing the number zero before the comma.
Example: 0,15, ok, accept nice. But if you type: ,15, it doesn't work.

The error occurs in the JvBaseEdits unit, IsValidFloat function, after activating the TextToFloat function.


function:
function IsValidFloat(const Value: string; var RetValue: Extended): Boolean;
var
   I: Integer;
begin
   Result := False;
   for I := 1 to Length(Value) do
     if not CharInSet(Value[I], [JclFormatSettings.DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then
       exit;
   Result := TextToFloat(PChar(Value), RetValue, fvExtended);
end;

In Delphi Alexandria 11, Result := TextToFloat(PChar(Value), RetValue, fvExtended); returns "True".

In Delphi Alexandria 11.1, Result := TextToFloat(PChar(Value), RetValue, fvExtended); returns "False".

The value of the variable "Value", is ","

The value entered was just the comma, without the zero before.
Steps To Reproduceinstall delphi alexandria 11.1
Install last jvcl and jcl
place a TJVDBCalcEdit in the form
now, clear TJVDBCalcEdit
now, type , or . 15 Ex: ,15
TagsNo tags attached.

Activities

acgubamg

2022-04-29 05:18

reporter  

Projects.zip (94,038 bytes)

Issue History

Date Modified Username Field Change
2022-04-29 05:18 acgubamg New Issue
2022-04-29 05:18 acgubamg File Added: Projects.zip