[Lazarus] Missing keyboard input

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Apr 26 11:14:08 CEST 2009


Hans-Peter Diettrich wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">Graeme 
> Geldenhuys schrieb:
>
>>> You would need to know at least what is the exchange rate for a given
>>> conversion.
>>
>> And the currency type and the rounding method use (maybe even per
>> currency) and the preferred decimal numbers used (again maybe per
>> currency) etc...
>
> Monetary calculations often are prescribed precisely, e.g. for taxes. 
> These prescriptions as well as the preferred scaling are country 
> specific. We just had a discussion about currencies where the base 
> unit equals e.g. 1E-6 USD, where 64 bit and 4 decimal places are no 
> more applicable, even for calculations in one currency.
>
>> Something that seemed so simple in the beginning can become quite a
>> complex task. ;-)
>>
>> Now similar issue can be applied to TDateTime and String types.
>
> Unlike other measure types (including date, temparature, length...), 
> currencies have variable conversion rules or factors. In former days 
> (some) currencies were based on gold or silver (Pound Sterling, 
> Silverdollar, Goldmark...), usable as a common base for exchange 
> calculations, but nowadays IMO all currencies are floating. Any fixed 
> conversion methods will result in kind of weather forecast ;-)
>
> DoDi
>
The Currency type is just a float with 4 decimal places and some special 
rounding behaviour that I cannot remember. Currency conversions and all 
the rest is up to you as a programmer and your application.

I think that TDateEdit.Date should be published. This is the behaviour 
of the JEDI TJvDateEdit and the Delphi date picker.
If this exposes a bug then that is what needs to be fixed.
>
> </div>
>




More information about the Lazarus mailing list