Sorry, I forgot about negative numbers.  It should be:

SN0001 := "Number is: ",TRUNC(RI0001), ".", ABS(TRUNC((RI0001 -
TRUNC(RI0001))
        * 100.0));

        John Windle


> -----Original Message-----
> From: Windle, John [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 11:47 AM
> To:   'Foxboro DCS Mail List'
> Subject:      RE: SENDMSG and real numbers
> 
> Try:
> SN0001 := "Number is: ", TRUNC(RI0001), ".", TRUNC((RI0001 -
> TRUNC(RI0001))
> * 100.0);
> 
> Where SN0001 is the output string and RI0001 is the floating point to
> convert and 100.0 is the decimal precision.
> 
> It's ugly, I tried it and it works.
> 
> 
> John Windle
> 
> > -----Original Message-----
> > From:       Sieling, Marcel [SMTP:[EMAIL PROTECTED]]
> > Sent:       Monday, April 09, 2001 11:19 AM
> > To: 'Foxboro DCS Mail List'
> > Subject:    SENDMSG and real numbers
> > 
> > Hi,
> > 
> >     >Is there any way to teach HLBL not to do this and to output real
> > numbers like the rest of the system does?
> > 
> > As far as I know no. I solved these kind of problems with two integers
> and
> > a
> > "." in between and a little calculation around it. Could be done in a
> > subroutine and is definetely not the most elegant way. If anyone knows a
> > better way and tells it to me he earned himself a beer next time when
> he's
> > in Dusseldorf (and we have good beer!).
> > 
> > best regards -
> > 
> > Marcel Sieling
> > Systems Technologies
> > 
> > FOXBORO Deutschland GmbH
> > Heerdter Lohweg 53 - 55
> > 40549 Duesseldorf
> > Tel.:        +49 (0)211 5966-171
> > Fax:         +49 (0)211 5966-104
> > Mobile:      +49 (0)172 2673077
> > E-Mail:      [EMAIL PROTECTED]
> > http://www.foxboro-deutschland.de
> > Private Home: http://www.powerslider.de
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von:      Sascha Wildner [SMTP:[EMAIL PROTECTED]]
> > > Gesendet am:      Montag, 9. April 2001 17:14
> > > An:       Foxboro Mailing List
> > > Betreff:  SENDMSG and real numbers
> > > 
> > > Dear List,
> > >  
> > > I have here a sequence which has to output status messages in one of
> its
> > > string outputs (SNxxxx).  I use SENDMSG but whenever I want to output
> a
> > > real value like in
> > >  
> > > USER_LABELS
> > >     STATUS_TXT: SN0001;
> > >  
> > > SENDMSG("Tank level is now ", CMP:AIN.PNT, "%") TO STATUS_TXT;
> > >  
> > > it gives me this scientific format (sign, number, exponent).  I've
> never
> > > heard of any customer who wanted this format so it is really the
> > pessimal
> > > solution.  Is there any way to teach HLBL not to do this and to output
> > > real numbers like the rest of the system does?
> > >  
> > > Regards,
> > > Sascha
> > >  
> > 
> > -----------------------------------------------------------------------
> > This list is neither sponsored nor endorsed by the Foxboro Company. All
> > postings from this list are the work of list subscribers and no warranty
> > is made or implied as to the accuracy of any information disseminated
> > through this medium. By subscribing to this list you agree to hold the
> > list sponsor(s) blameless for any and all mishaps which might occur due
> to
> > your application of information received from this mailing list.
> > 
> > To be removed from this list, send mail to
> > [EMAIL PROTECTED] 
> > with "unsubscribe foxboro" in the Subject. Or, send any mail to
> > [EMAIL PROTECTED]
> 
> -----------------------------------------------------------------------
> This list is neither sponsored nor endorsed by the Foxboro Company. All
> postings from this list are the work of list subscribers and no warranty
> is made or implied as to the accuracy of any information disseminated
> through this medium. By subscribing to this list you agree to hold the
> list sponsor(s) blameless for any and all mishaps which might occur due to
> your application of information received from this mailing list.
> 
> To be removed from this list, send mail to
> [EMAIL PROTECTED] 
> with "unsubscribe foxboro" in the Subject. Or, send any mail to
> [EMAIL PROTECTED]

-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All postings from 
this list are the work of list subscribers and no warranty is made or implied as to 
the accuracy of any information disseminated through this medium. By subscribing to 
this list you agree to hold the list sponsor(s) blameless for any and all mishaps 
which might occur due to your application of information received from this mailing 
list.

To be removed from this list, send mail to [EMAIL PROTECTED] 
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]

Reply via email to