Jim Freeze wrote:

>* Jon A. Lambert <jlsysinc / alltel.net> [2005-04-24 19:47:10 +0900]:
>  
>
>>decimal(15,2) x;
>>    
>>
>Hmm, could this be emulated with a wrapper around BigDecimal?
>  
>
In the office I have a little something to parse or generate 
mainframe-style data files. There I can write things like

FooData < AbstractDataRecord
  decimal :some_field, 15, 2
  fixed_ebcdic :some_other_field, 35
end

FooHeader < AbstractDataRecord ...
FooTrailer < AbstractDataRecord ...

FooBarFile < AbstractDataFile
  header FooHeader
  many FooData
  trailer FooTrailer
end

I played with the idea of using BigDecimal, but eventually used strings 
for internal representation of everything, because it is much easier 
that way and fast enough for my purposes. If I were to make a report 
generator, it would probably be the same choice.

-- 
Best regards,

Alexey Verkhovsky

Ruby Forum: http://ruby-forum.org        (moderator)
RForum:     http://rforum.andreas-s.net  (co-author)
Instiki:    http://instiki.org           (maintainer)