[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Numeric-format for STRING(DECIMAL)

  • Thread starter Thread starter gus bjorklund
  • Start date Start date
Status
Not open for further replies.
G

gus bjorklund

Guest
Values of all 4GL datatypes are stored in the database (and in 4GL runtime's local memory) in a format neutral and processor architecture neutral form. The supported numeric types are integer, decimal and float and each has its own storage format. The values of type decimal are stored as a string of 4-bit “nibbles” preceded by a length byte and a "control byte”. Each nibble represents one digit of the value. The control byte is, if negative, the number of digits to the right of the decimal point. If positive, then digits to the left of the decimal point + 0x80. The maximum number of digits is 32. The display format has nothing at all to do with the storage format. This is a good thing. You should store decimal values as a value of type decimal, not something else like string. When converting values from decimal storage to text, use whatever format is suitable for your intended use.

Continue reading...
 
Status
Not open for further replies.
Back
Top