Juergen Immel wrote:
>> He everyone
>> we do have a big problem with very large numbers in real and money
fields.
>> We use mSql 2.0.11 to program an information application for one of our
>> customers and there is one script which calculates totals for different
>> groups of articels. This script provides wrong totals. If I import the
data
>> into Excel everything works fine, but the script, which should insert
the
>> totals into the main table just inserts garbage.
>> PLEASE HELP
>> this is urgent.
Juergen,
try a radical approach - forget the money field altogether.
Store all your data as pfennigs (using an integer field) instead D-marks
and the problem goes away.
You also gain a ton in portability.
Then all you need is two functions that will convert pfennigs into D-marks
for printing,
e.g. takes an int 325 and returns a string "DM 3,25"
I have used this approach since MSQL v1 (which doesn't have a currency
field) and it's alomst foolproof.
The only problem is sometimes if you hardcode constants (baad!) you may
accidentally put them in pfennigs instead of D-marks, or forget to convert
a pfennig number to D-mark before outputting to browser or debiting
somebody's credit card (ouch!).
Good luck.
Carlo.
-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/
This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:04:03 EST