Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005841 [JEDI VCL] 00 JVCL Components minor always 2012-03-23 03:48 2013-12-13 11:22
Reporter acgubamg View Status public  
Assigned To obones
Priority normal Resolution suspended  
Status resolved   Product Version Daily / GIT
Summary 0005841: TJvCalcEdit.Text
Description function TJvCustomNumEdit.GetEditFormat:String;
begin
  Result := ',0'; // must put the thousands separator by default to allow direct edit of value (paste for example)
  if FDecimalPlaces > 0 then
    if FDecimalPlacesAlwaysShown then
       Result := Result + '.' + MakeStr('0', FDecimalPlaces)
    else
       Result := Result + '.' + MakeStr('#', FDecimalPlaces);
end;

a funcao acima alterada, quando FDecimalPlaces = 0 sempre mostra o text como
6.102, se digito 6102 e em seguida mostro o valor de jvcalcedit1.text mostra como '6.102' e não como '6102'

Não poderia ser alterado para o código:

function TJvCustomNumEdit.GetEditFormat:String;
begin
  if FDecimalPlaces = 0 then
    Result := '0'
  else
  begin
    Result := ',0';
    if FDecimalPlacesAlwaysShown then
       Result := Result + '.' + MakeStr('0', FDecimalPlaces)
    else
       Result := Result + '.' + MakeStr('#', FDecimalPlaces);
  end;
end;

Dessa forma se FDecimalPlaces for maior que zero, mostra o separador, caso contrário, permanece o número como inteiro. E ao utilizar o jvcalcedit1.text como inteiro, retorna apenas números.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0019681)
acgubamg (reporter)
2012-03-23 03:52

google translation:

the above function changed when FDecimalPlaces = 0 always shows the text as
"6.102", if I type 6102 and then show the value of '6.102' jvcalcedit1.text shows how and not '6102'

There could be changed to the code:
function TJvCustomNumEdit.GetEditFormat:String;
begin
  if FDecimalPlaces = 0 then
    Result := '0'
  else
  begin
    Result := ',0';
    if FDecimalPlacesAlwaysShown then
       Result := Result + '.' + MakeStr('0', FDecimalPlaces)
    else
       Result := Result + '.' + MakeStr('#', FDecimalPlaces);
  end;
end;

Thus if FDecimalPlaces is greater than zero, the separator shown, otherwise, it remains as an integer number. And when using the jvcalcedit1.text as integer, returns only numbers.
(0019843)
obones (administrator)
2012-06-11 17:24

Please provide the zipped sources of a sample application showing this.
(0020768)
obones (administrator)
2013-12-13 11:22

No news, suspending the issue

- Issue History
Date Modified Username Field Change
2012-03-23 03:48 acgubamg New Issue
2012-03-23 03:52 acgubamg Note Added: 0019681
2012-03-23 03:58 acgubamg Issue Monitored: acgubamg
2012-06-11 17:24 obones Note Added: 0019843
2012-06-11 17:24 obones Status new => feedback
2013-12-13 11:22 obones Note Added: 0020768
2013-12-13 11:22 obones Status feedback => resolved
2013-12-13 11:22 obones Resolution open => suspended
2013-12-13 11:22 obones Assigned To => obones


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker