Stop the rounding
Bruce Easton
bruce at stn.com
Mon Sep 17 07:48:29 PDT 2007
Jose Lerebours wrote Friday, September 14, 2007 8:11 PM:
> Steven posted:
>
[..]
> > I am trying to strip the decimal out of a number.
> > I have this written;
> >
> > cb(10,.0)=25
> >
> > 25 is (10,.2)
> >
> > if the number for field 25 is 880.88
> > I get 881 out for dummy cb
> > or if the number is 710.00 I get 710 instead of 71000
> >
> > How do you strip out a numbers decimal and stop the rounding
> and dropping of
> > the 00
> >
>
> Steven,
>
> If you have 880.88 and you wanted 88000 you simply must
>
> cb(10,.0) = int(25) * "100"
>
> In the same token, if you had 710.00 and wanted 71000
>
> cb(10,.0) = int(25) * "100"
>
> given that field 25 holds any of these values at any given
> time.
>
> Not need to use xlate(), no need to use mid(), no need to break the field
> into multiple fields and put it back together.
>
> That said, if you DO want to round up and elevate it, you can then try
>
> cb(10,.0) = doedit(25,"10,.0","10") * "100"
>
>
But Jose, Steven said subsequent to his original post:
> I did What I thought was easy. I added *"100" and changed
> cb from (10,.0) to just (10)
>
> cb(10)=25*"100"
>
> this keeps all numbers.
and in another email:
> I am exporting out of Filepro to An EDI program.
(plus his subject is 'stop the rounding'),
so he doesn't need an int function applied since he
truely does not want any rounding.
As Roger Cornelius pointed out - just
mutiplying by "100" should be the simplest way.
(But this depends on the source field always having
edit .2, and also depends on the target field always
needing to be an integer where the two right-most
digits are assumed to be cents - and that seems
to be the case here).
Bruce
Bruce Easton
STN, Inc.
More information about the Filepro-list
mailing list