Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: CSS : Label display precision
From: Amien Crombie <acrombie@tlabs.ac.za>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 19 Feb 2015 13:49:11 +0200
Hi
Here is the code I'm struggling with:

// _javascript_ file
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
importPackage(Packages.java.lang);
importPackage(Packages.java.util);

var lb = display.getWidget("Label_5");
var cset  = PVUtil.getDoubleArray(pvs[1]); // Get its double Array values from the 2nd PV waveform

var value = cset[0].getValue();   // just extract first element of array

lb.setPropertyValue("text", value);
//

My Label_5 displays a huge demical (like '1.7293458101234' etc).
I just need to have a precision of 2 '1.73' etc...
Any way to do this..

Thanks
Amien



Replies:
Re: CSS : Label display precision Hugo Slepicka

Navigate by Date:
Prev: RE: Using the EPICS Build/Make system to build kernel modules for linux Williams Jr., Ernest L.
Next: Re: CSS : Label display precision Hugo Slepicka
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: CSS - Reverse Scale Amien Crombie
Next: Re: CSS : Label display precision Hugo Slepicka
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·