recovery

Mike or Penny Novack stepbystepfarm at mtdata.com
Wed Oct 31 15:43:04 EDT 2007


>Long ago, gnucash stored its data in binary, with its amounts of money 
>recorded in binary floating-point.  I pointed out that this was not 
>adequate for financial data, wiere pennies matter on amounts line a 
>billion dollars, and the roundoff errors involved in binary/decimal 
>conversion are ultimately unacceptable.
>
>This started a revolution in which money would be represented in exact 
>form; as it happens they chose character strings that represented 
>amounts as an intergal number of tiny units of currency.  For my 
>accounts, this unit turned out to be a penny.  I gather it's different 
>for stock-trading accounts.
>
>  
>
Suggestion (from somebody who used to do "financial" software for a living)

That solution would be unnecessarily slow (repeated data conversion back 
and forth). The database and all calculations can be integer and only 
when the figures are to be displayed are they edited (decimal point 
inserted at the appropriate place). AKA "scaled decimal" representation. 
Fairly easy to write "edit mask" functions if not directly supported by 
language/hardware (precisely because of this usage COBOL and the IBM 
mainframes used in "financial" work provide for "edit mask" as a 
primitive ---- in other words, you can define a "mask" specifying fairly 
complex number editing and that determines how that number DISPLAYS)

Michael


More information about the gnucash-user mailing list