Howdy All - I am using MySQL 3.23.46-Max under Red Hat 7.2
I am trying to use DECIMAL type columns to work with huge numeric (monetary) values. I figured out how to get large numbers into DECIMAL types by passing them as strings: mysql> insert into khtest set k1=1,t1="123456789012345678.10"; Query OK, 1 row affected (0.00 sec) mysql> insert into khtest set k1=2,t1="123456789012345678.10"; Query OK, 1 row affected (0.00 sec) mysql> select * from khtest; +----+-----------------------+ | k1 | t1 | +----+-----------------------+ | 1 | 123456789012345678.10 | | 2 | 123456789012345678.10 | +----+-----------------------+ 2 rows in set (0.00 sec) But, I cannot update them correctly using either strings or numbers: mysql> update khtest set t1 = t1 + .15 where k1 = 1; Query OK, 1 row affected (0.05 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update khtest set t1 = t1 + ".15" where k1 = 2; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from khtest; +----+-----------------------+ | k1 | t1 | +----+-----------------------+ | 1 | 123456789012345680.00 | | 2 | 123456789012345680.00 | +----+-----------------------+ 2 rows in set (0.00 sec) Yes, I RTFM (and also this list's archives) and I know that DECIMAL columns are limited in range to doubles, but, I was wondering: 1) If anyone out there has worked with huge numbers before and run into this issue? 2) What solution did you use to get around this? 3) Does anyone know of a good inexpensive library to handle huge number math? (Rogue Wave has one, but it is expensive) 4) Does anyone know of a clone for the MS currency type variable? (that would work, too) I looked on the internet, but didn't have much luck finding anything useful. TIA for your help! Ken Hylton Programmer Analyst IV LEC Systems & Programming Billing Concepts, Inc. 7411 John Smith Drive San Antonio, Texas 78229-4898 (210) 949-7261 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php