Integer part only
Hi everybody,
I'm a brand new user of Labview (v 2009). I try to save some data from my electrometer (Keithley 617) in an array (time and electric current). And it works, I can see these data in a text file, with the time on the left, and on the right the value of the current. The issue is that I can only record the integer part. The current I try to record is something like 10E-12 A. So if I don't multiply the result by a constant of 10E15 for example, the result would be 0 instead of 0.00...004658 A. And it is the same for the time. I can see 1, 1, 1, 2, 2, 3, 3 instead of 1.034, 1.45, 1.89, 2.36, 2.98, 3.48, 3.95 for example. I've try to change the format, but it doesn't solve this problem of the integer part. I'd like to see the whole number (integer and decimal parts). Attached, please find my program. Also I attached 2 files. test01 is what I'd like to record, and test02 is what I currently record. Could you help me please ?
Thank you !
PS : I try to expose as best as I can my problem, I'm French...
Solved!
Go to Solution.
Attachments:
Keithley 617a Yang.vi 27 KB
test01.txt 3 KB
test02.txt 1 KB
Ok I think I found a solution. A double precision float "DBL" was missing just before the "measurement" part. I attach you my program and the results.
Thank you for your help !!
Thomas.
Attachments:
Keithley 617b Yang.vi 26 KB
test02.txt 1 KB
Similar Messages
-
Get integer part of a double type value.
double dblVal=150.50;
how will i get the integer part only of variable dblVal?
i want to get the 150 only. please help.
killuasoftWhy would you want to do this? This can overflow your
int for sufficiently large double values, even when
using a long instead of an int.Maybe he previously did a range check or otherwise knows the range of possible values. -
Hi everybody,
How I can to get only integer part of real number in FormCalc?
Tanks
EmersonI find a solution using a Floor(realnumber).
-
Fix the integer part in a decimal numer
i copy the following code from this forum
import java.awt.*;
import java.text.*;
import javax.swing.*;
import javax.swing.text.*;
public class Decimal1
public static void main(String[] args)
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(200,130);
f.setLocation(400,300);
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
f.getContentPane().add(panel);
DecimalFormat df = new DecimalFormat("0.00");
NumberFormatter nfr= new NumberFormatter(df);
nfr.setAllowsInvalid(false);
JFormattedTextField ftf = new JFormattedTextField(nfr);
JLabel lFtf = new JLabel("JFormattedTextField");
JLabel lTf = new JLabel("JTextField");
JTextField tf = new JTextField(8);
panel.add(lFtf);
panel.add(ftf);
panel.add(lTf);
panel.add(tf);
f.setVisible(true);
}i want the user to input the price (the format "99999.99", the integer part is less than 5 digits. the decimal part is fixed to 2 digits)
for example 56.45, 0.67 12345.99 , 88888.12 are accepted.
if the integer part is more than 5 is not allowed.
for example 123456.45, 651433.44
i try it with Document, buy it cannot work together.
how can i to solve it?
thank you!You might want to start looking at [url http://forum.java.sun.com/thread.jspa?threadID=5164412&messageID=9629730#9629730]the threads you've previously started on the topic.
-
Like the question suggests, I'm thinking about purchasing one of the new 27'' iMacs and I'm wondering if I'd be possible to repartition the 3TB fusion drive to use the 128GB SSD part only for the OS.
Thanks a lot for this fast and helpful reply!
€dit: I accidentially clicked on "This helped me" instead of "This solved my question" and now it seems like I'm unable to change that :/ -
Getting the integer part of a float?
This sure is a simple problem, but i couldn't find an appropriate methode or class so i just like to aks you, wheter you have an idea:^
how do i get the integer part of a float? i mean, how do i get the "14" from the float "14.45698"?Sounds like you need to explicitly cast it to an integer, like this:
double number1 = 14.45698;
int number2 = 0;
number2 = (int) number1;
Hope this helps. -
[SOLVED] grep output matching parts only
I want grep to output only what it matched, but according the man page, it will put each matching part on a separate line, which does not work for me. I am matching two numbers, but they don't get output together, but each on a separate line. Any idea how to fix this?
Here is my code:
[x@arch ~]$ sudo hddtemp /dev/sda|cut -f4 -d" "|grep [[:digit:]+] -o
4
6
Last edited by awayand (2012-03-31 05:08:06)awayand wrote:
genius. thanks, dev/zero!
sudo hddtemp /dev/sda |cut -f4 -d" "|tr -cd [:digit:]
Haha, the actual solution you found is more elegant than the one I had in mind!
sudo hddtemp /dev/sda | cut -f4 -d" " | grep [[:digit:]+] -o | tr '\n' ' ' | sed 's| ||g' -
Returns the integer part of a real number
Hello,
I need to know an integer value as part of a real number, like this:
double a = 0;
double x = 0;
x = 1500.00;
a = (x / 1000);
now "a" must be equal to 1.
Pascal has a function INT (a = INT(x/1000)), and what about java ?
Thanks for help,
guidoHello,
I need to know an integer value as part of a real
number, like this:
double a = 0;
double x = 0;
x = 1500.00;
a = (x / 1000);
now "a" must be equal to 1.
Pascal has a function INT (a = INT(x/1000)), and what
about java ? It is almost the same thing.
double d = 1.5;
int i = (int) d; -
Use of Byte: How can Integer.byteValue() only return 1 byte?
The usefulness of the byteValue function contained in both Integer and Float has the potential to be useful, however, this function returns only one byte. I know the number of bytes associated with each type differs on different platforms, but could this function not return an array of bytes?
Any suggestions on a workaround, or a better explanation of something I am missing?1) the amount of bytes associated with each type does NOT depend on the platform. They are fixed in the language spec.
2) the methods may not return arrays of bytes since they are defined to return the byte value of the Number at hand. The byte value is defined to be the int value cast to byte.
If you want to play with bits you'll have to write your own "parser" using the bitwise operators and getRawBits (?) with floating point types. Or use DataOutputStream to write the bytes to a ByteArrayOutputStream that you can then use to get the bytes.� -
I have 2 different projects in RoboHelp 11 that have a "common" part, i.e. several chapters are identical, eventually with minor changes that could be solved with flags, and I was wondering if it would be possible to have the "common" in a sub-project that I could manage for both other projects.
Hi there
No, not RoboSource Control.
If you click View > Pods > Resource Manager, you should see the Resource Manager pop open. From there, you are able to create a location that would be "shared" between projects or between authors.
So you create a location, then take the topics that are "common" and place them into that spot by dragging from the project to the Resource Manager window. RoboHelp should make copies there. Then in the other project, you open the Resource Manager and drag the topics from the Resource Manager window to the project. Perhaps one of the topics is named: Feeding Alligators
Once you have done this, perhaps you change some text or add an image to the "Feeding Alligators" topic. Resource Manager should then prompt you to say that the topic in your project no longer matches the topic in the Resource Manager. You should have an option to synchronize it. And at that point, the process should copy the topic from the project to the Resource Manager location. Then when you open the other project, Resource Manager would then again tell you that what is in the Resource Manager is different than what is in the project. And offer an option to synchronize it. And at that point, the content would be copied from the Resource Manager to the project.
Pretty slick when you think about it!
Cheers... Rick -
Moving object and selection on integer pixel only?
Hello,
I am working on Flash CS5 , and I would like to "lock" any moves or selection on the pixel grid.
For example if I am moving with my mouse a square placed at x:10 and y:56 I want to have someting like x:456 and y:78 and NOT x:456,4 and y:78,8
Same thing for the selection, it select sometimes half of a pixel or a quarter, and it is very anoying... I am loosing a lot of time to check every element each time I placing, moving or selecting or creating to be sure it is an integer number.
Is there a posibility to do that?
thanks a lot.Ho dear...
I tried that but it seem not working...
in fact I just understand, if you have an element placed at x=10.47 px if you check the snapping on pixel it will keep the 0,47px shift...
so I have to give it and integer number and then it will snap on the grid
thanks a LOT -
Book on AIF 2.0 - monitoring part only
Hi,
Just wanted to let you know that there's a new book on AIF's monitoring part:
New book: SOA Integration - Enterprise Service Monitoring (LIE, FEH/ECH, AIF)
BTW
it also describes the new features from latest SP levels like new reprocessing option
Thank you,
Regards,
Michal Krawczykhttp://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#i3305
19.1.1 How Execution Plans Can Change
With the query optimizer, execution plans can and do change as the underlying optimizer inputs change. EXPLAIN PLAN output shows how Oracle runs the SQL statement when the statement was explained. This can differ from the plan during actual execution for a SQL statement, because of differences in the execution environment and explain plan environment.
Execution plans can differ due to the following:
Different Schemas
Different Costs -
Want to truncate the integer part of a number
hi gurus
My requirement is round off a decimal value
in such a fashion that
if is 12.7767898 then convert to 12.50
again if it is 12.498989 convert to 12.50.
please help
Thanks in advanceYou could do something like this:
DATA: number(16) TYPE P DECIMALS 4.
whole_part(16) TYPE C,
remainder(4) TYPE C,
value(20) TYPE C.
MOVE number TO value.
SPLIT value AT ',' INTO whole_part remainder.
Then, examine the remainder:
IF remainder(1) GE '5'.
remainder = '5000'.
ELSE.
* do something else
ENDIF.
CONCATENATE whole_part ',' remainder INTO value.
In your data display method, display this character string (value) instead of the numerical value (number).
This is a bit unfortunate because you have to type cast your value to string, but it works well enough. Just make sure you don't have any arithmetical operations on this newly created data field because you will get an exception.
Also, please note that this is not the complete solution, but only to give you an idea.
Regards,
SD -
Sound stop working partly only ac3 is working[solved]
I hat this problem before but cant remember the solution or find the thread.
I know it is necessary to make alsa like after the first install but i really cant remember what to do. Just pacman -Rsc alsa-utils and later on pacman -S alsa-utils is not enough.
if there is anybody who can remember or enlighten my i would be pleased
Edit: I found some notes of mine. The problem is solved by cutting the rw rights of /etc/rc.d/alsa by chmod a-rw /etc/rc.d/alsa
Rebooting
using alsaconf and alsactl store
adjusting the rights by chmod 755 /etc/rc.d/alsa
and rebooting
Thanks to all who read this thread
Last edited by kendosperling (2008-05-19 16:54:15)The ATV is in recovery mode.
Do as the image suggests and connect the ATV to a computer via a microUSB cable then restore. -
Aps:button onClick event in Visual web part only fires first time - SharePoint 2013
Below is my markup from ascx file
<asp:Button ID="exporttopdf" runat="server" Text="Export To PDF"/>
C# code for button on click
protected void Page_Load(object sender, EventArgs e)
exporttopdf.Click += new System.EventHandler(this.exporttopdf_Click);
protected void exporttopdf_Click(object sender, EventArgs e)
if (Page.IsPostBack)
try
using (MemoryStream stream = new MemoryStream())
PdfPCell cell;
SPList list = SPContext.Current.Site.OpenWeb().Lists[this.ListName];
BaseColor rGBColor = WebColors.GetRGBColor("#AFAECE");
PdfPTable element = new PdfPTable(2)
TotalWidth = 300f,
LockedWidth = true
float[] relativeWidths = new float[] { 1f, 2f };
element.SetWidths(relativeWidths);
element.HorizontalAlignment = Element.ALIGN_MIDDLE;
element.SpacingBefore = 20f;
element.SpacingAfter = 30f;
if (this.PdfHeading != null)
cell = new PdfPCell(new Phrase(this.PdfHeading));
else
cell = new PdfPCell(new Phrase(this.ListName));
cell.Colspan = 2;
cell.Border = 0;
cell.Padding = 4;
cell.BackgroundColor = rGBColor;
cell.HorizontalAlignment = 1;
element.AddCell(cell);
Document document = new Document(PageSize.A4, 25f, 25f, 30f, 30f);
PdfWriter instance = PdfWriter.GetInstance(document, stream);
document.Open();
document.AddAuthor("Place Holder");
document.AddCreator("Place Holder");
document.AddKeywords("Place Holder");
document.AddSubject(this.ListName);
document.AddTitle(this.ListName);
instance.Info.Put(new PdfName("Producer"), new PdfString("Place Holder"));
PdfContentByte directContent = instance.DirectContent;
string[] separator = new string[] { ";", "," };
string[] strArray2 = this.ViewFields.Split(separator, StringSplitOptions.None);
new StringBuilder().Append(this.ListName + "\n");
foreach (string str in strArray2)
PdfPCell cell2 = new PdfPCell(new Phrase(str))
Border = 0,
Padding = 4,
HorizontalAlignment = 1
element.AddCell(cell2);
if (str != "Modified By" && str != "Created By")
PdfPCell cell3 = new PdfPCell(new Phrase(SPContext.Current.Item[str].ToString()))
Border = 0,
Padding = 4,
HorizontalAlignment = 1
element.AddCell(cell3);
else
string[] separatorc = new string[] { "," };
string[] strArray3 = SPContext.Current.Item[str].ToString().Split(separatorc, StringSplitOptions.None);
PdfPCell cell3 = new PdfPCell(new Phrase(strArray3[3].ToString().Substring(8).Replace(@"\\", @"\")))
Border = 0,
Padding = 4,
HorizontalAlignment = 1
element.AddCell(cell3);
PdfPCell cell4 = new PdfPCell(new Phrase("Footer"))
Colspan = 2,
Border = 0,
Padding = 4,
BackgroundColor = rGBColor,
HorizontalAlignment = 1
element.AddCell(cell4);
document.Add(element);
document.Close();
instance.Close();
stream.Close();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "pdf/application";
string filename = SPContext.Current.Item["Title"].ToString() + ".pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "inline;filename=" + filename);
HttpContext.Current.Response.OutputStream.Write(stream.GetBuffer(), 0, stream.GetBuffer().Length);
HttpContext.Current.Response.End();
catch (Exception exception)
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Export To PDF", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, exception.Message, new object[] { exception.StackTrace });
else
HttpContext.Current.Response.Write("<script language=javascript>alert('ERROR');</script>");
it works fine first time but does not do anything from second.
any advice?Hi,
Please try to the code snippet as below:
VisualWebPart1.ascx:
<asp:Button ID="exporttopdf" runat="server" Text="Export To PDF" OnClick="exporttopdf_Click"/>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
VisualWebPart1.ascx.cs:
protected void Page_Load(object sender, EventArgs e)
protected void exporttopdf_Click(object sender, EventArgs e)
Label1.Text = System.DateTime.Now.ToString();
If the code still do not work from second, I suggest you debug your code and check whick line of code occur the error.
More information:
http://social.msdn.microsoft.com/Forums/office/en-US/94931a08-f204-4d30-a230-f468815a76e8/export-aspnet-gridview-to-pdf-from-visual-webpart?forum=sharepointdevelopmentprevious
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support
Maybe you are looking for
-
My iPad mini (about a month old) won't automatically change to landscape view in any apps or portals. The menu does, but once I click on an app or portal it reverts back to portrait view. How can I get it to do it automatically as it used to? Thanks
-
Setting up a webservice url for consumption in browser
Hi, I am new at webservices and all this fancy stuff... I managed to set up a webservice wrapper in NW Developer Studio for my stateless session bean endpoint creating an order in our 3rd party erp system. So far so good, I ceated a client proxy and
-
How can I uninstall / remove HP printer drivers and software?
Hi, I tried using the HP uninstall program to remove the HP printer drivers and related software, but I still see them in my hard drive. I see HP files in my Library/Preferences and Library/Printers folder. I will remove them by hand. Are there other
-
Please help me with my Ipod Touch 4th Gen.
I erase all the data of my ipod touch 4th generation by clicking the settings and go to erase all data. after erasing the indicator shown that the data is erasing but suddenly it hang up and only the apple logo shown. I tried to press the sleep and
-
Can you make a pdf a jpeg?
Can a take my PDF file and turn it into a picture like a jpeg?