![]() |
AW: Count digits after point
as the others have said, it has something to do with the approach.
but look at this. maybe it will help you! ps: doenst work for all numbers! for example x,42300000000000000001 Edit: e was randomly generated
Code:
const
e = 0.0000000001; function CountDigitsAfterPoint(AValue: Extended): Byte; var r: Extended; begin Result := 0; r := Int(AValue); while ((Frac(AValue) <> 0) and ((AValue - r) > e)) do begin Inc(Result); AValue := AValue * 10; r := Int(AValue+e); end; end; |
Re: Count digits after point
Thanks, for all values I used early, is working correctly.
BTW: why e has that value, can have other values? |
AW: Count digits after point
e is just a small number close to zero. it doesn't matter if there's one zero more or one less.
|
AW: Re: Count digits after point
Zitat:
![]() ![]() Another helpful article is ![]() |
AW: Re: Count digits after point
Zitat:
Showing the number of decimals is definitely not something to please the eye. It is showing the accuracy of your value, so a value of, say, 100 (metres) measured up to a mm is correctly shown as "100,000 m" whereas the same value with an accuracy of 1m is shown as "100m". |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:18 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