EPICS Home

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  2021  2022  2023  2024  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  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: CSS : Label display precision
From: Amien Crombie <[email protected]>
To: "[email protected]" <[email protected]>
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  2021  2022  2023  2024 
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  2021  2022  2023  2024