* Patch from LacaK2 to improve decimalpoint localisation. (Mantis 18338)

git-svn-id: trunk@16653 -
This commit is contained in:
marco 2010-12-29 12:33:14 +00:00
parent 327b570ea4
commit ff2292aafa

View File

@ -1202,7 +1202,7 @@ IMPLEMENTATION
pack_BCD := True; pack_BCD := True;
end; end;
procedure SetDecimals ( var dp, procedure SetDecimals ( out dp,
dc : Char ); dc : Char );
begin begin
@ -1704,6 +1704,7 @@ IMPLEMENTATION
l : {$ifopt r+} 0..maxfmtbcdfractionsize + 1 + 1 {$else} Integer {$endif}; l : {$ifopt r+} 0..maxfmtbcdfractionsize + 1 + 1 {$else} Integer {$endif};
i : {$ifopt r+} low ( bh.FDig )..high ( bh.LDig ) {$else} Integer {$endif}; i : {$ifopt r+} low ( bh.FDig )..high ( bh.LDig ) {$else} Integer {$endif};
pp : {$ifopt r+} low ( bh.FDig ) - 1..1 {$else} Integer {$endif}; pp : {$ifopt r+} low ( bh.FDig ) - 1..1 {$else} Integer {$endif};
dp, dc : Char;
begin begin
{$ifdef use_ansistring} {$ifdef use_ansistring}
@ -1712,6 +1713,7 @@ IMPLEMENTATION
unpack_BCD ( BCD, bh ); unpack_BCD ( BCD, bh );
WITH bh do WITH bh do
begin begin
SetDecimals ( dp, dc );
l := 0; l := 0;
if Neg if Neg
then begin then begin
@ -1742,9 +1744,9 @@ IMPLEMENTATION
then begin then begin
{$ifndef use_ansistring} {$ifndef use_ansistring}
Inc ( l ); Inc ( l );
result[l] := '.'; result[l] := dp;
{$else} {$else}
result := result + '.'; result := result + dp;
{$endif} {$endif}
end; end;
{$ifndef use_ansistring} {$ifndef use_ansistring}
@ -3755,9 +3757,6 @@ end;
function VarToBCD ( const aValue : Variant ) : tBCD; function VarToBCD ( const aValue : Variant ) : tBCD;
begin begin
if VarIsFmtBCD(aValue) then
Result:=TFMTBcdVarData(TVarData(aValue).vPointer).BCD
else
Result:=VariantToBCD(TVarData(aValue)); Result:=VariantToBCD(TVarData(aValue));
end; end;