![]() |
Re: Großer Hex-String in Dezimal String wandeln, rundungsfeh
Hallo ruedi,
ich vermute, dass eine Umprogrammierung des FPU Control Word Schuld am Verlust der Genauigkeit ist. Ich habe das jetzt nicht nachzustellen versucht, aber ich könnte dir eine unempfindliche Lösung anbieten:
Delphi-Quellcode:
Das soll nur das Prinzip zeigen. Optimierungen sind möglich, aber eventuell unnötig.
uses
FmtBcd; function HexToDec(const s: string): string; var total, nibble: TBcd; i: Integer; begin total := IntegerToBcd(0); for i := 1 to Length(s) do begin nibble := IntegerToBcd(StrToInt('$' + s[i])); BcdMultiply(total, 16, total); BcdAdd(total, nibble, total); ShowMessage(BcdToStr(total)); end; Result := BcdToStr(total); end; Freundliche Grüße |
Re: Großer Hex-String in Dezimal String wandeln, rundungsfeh
Wow :-D :-D :-D es funktioniert... vielen, vielen Dank Marabu... würd dich gern auf ein Bier einladen :cheers:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:32 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz