OK
SO, it's report that makes bills to customers
In the detail there's a number called Tot_Inc, which is
the price of that order-line.
The total VT_TotInc of the bill is calculated and printed
in the footer of the detail-section with VT_TotInc=Som
([TotInc]), a currency with 2 decimal places. This
calculation is always ok, also with negative numbers.
On another part of the bill, the page-footer, this total
has to be split in an integer part and a decimal part to
be shown on different places on the bill. I calculated
the integer part with:
=Fix([VT_TotInc]), fixed notation, 2 decimals
The decimal part with:
=Right(CStr([VT_TotInc]*100);2), fixed notation, 0
decimals
And that goes wrong, if only with decimal numbers.
There's no more coding or calculaing than that.
As I said, I tried lots of things. I can see that in the
translation to string this strange 9 appears, because
when I use for the decimal-part only =CStr([VT_TotInc]) ,
there appears -9,99999999999091E-3, so the thing is
rounding numbers in a way I do not want at all. I just
want to see the two decimals that I see also in the first
total Som([TotInc])
Thanks for your help!
Frank
-----Original Message-----
Frank -
After rereading your post, I believe that there is something else going on
in your code that is causing the right-hand number to change from 01 to 91
in your situation. Can you post the entire code that is manipulating the
"numbers"? The example that I gave you below may not be what you seek at
all.
--
Ken Snell
<MS ACCESS MVP>
To get the negative numbers to work, try this:
RightHandNumbers = Sgn([VT+TotInc]) * CInt(Right(CStr ([VT_TotInc]))).
--
Ken Snell
<MS ACCESS MVP>
I get the dicimal part with =Right(CStr([VT_TotInc]
*100);2) where VT_TotInc is the number (example: 3,23)
and the whole part with =Fix([VT_TotInc]), last one with
0 decimals.
With negative numbers this goes wrong.
Thanks for any help!
Frank
-----Original Message-----
On a cheque I want to split a number in its whole value
and the 2 decimals. I.e. ? 2,34 becomes 2 and in
another
field 34. All is fine, exept with negative numbers.
-0,01 becomes 0 (OK) but the other part (01) in the
decimals-field shows 91. I tried to fix it with right,
mid, instr, fix... nothing works ok all the time. I
also
experimented with notation and the number of decimals.
Post the method by which you are doing the splitting and
we may be able to help.
--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at
http://www.mvps.org/access)
NO Email Please. Keep all communications
within the newsgroups so that all might benefit.<<
.
.