How to manipulate a number from a string
Hi All
I am using CRXI and have designed a report that will list all of our fleet starting with the 'Fleet No.' The fleet no. field is a string so that the fleet no.s weren't displaying in numerical order. I converted the field to a number and it then worked fine. Now, of course, the boffins have decided to create new fleet no's '7110.1'. With the field being a number these weren't displaying on my report. I thought if I played with the 'decimal points' that would help. My report now has '101.0' instead of '101' as well as displaying '7110.1'. Is there a formula to suppress the decimal point if it is zero?
Thanks in advance for your help
Please try this:
1. Right click on the field (formula field for FleetNo - {@numFleetNo})
2. Select Format field.
3. Select the Number Tab
4. Click on Customize...
Write the following formula in front of Decimals and Rounding by clicking on X-2 editor of both.
if {@numFleetNo} - Floor ({@numFleetNo}) = 0 then
0
Else
1
Hope this will help.
Similar Messages
-
How to find number from text string??
Hi All,
Can you tell me how to find/ fetch number from string?
is there any function module for this.?
for example , I have string like "+++++1000000589+++"
and I need to fetch the invoice no 1000000589 from the above string..then How to do that? Letters may come first or number may come first and latter text...
Regards,
MrunalYou can do like this.
The below mentioned is code separate material
DO 18 TIMES.
LV_C = LV_C + 1.
LV_C1 = LV_C - 1.
IF GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
IF ( ( LV_MAT EQ SPACE ) ) ." and ( lv_prefix eq space ) ) .
LV_PREFIX = 'X'.
CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-PREFIX.
ELSE.
LV_SUFFIX = 'X'.
CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-SUFFIX.
ENDIF.
ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
LV_MAT = 'X'.
CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-MATNR1.
ELSEIF ( ( LV_MAT EQ 'X' ) ) .
CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-SUFFIX.
ENDIF.
ENDDO. -
How to extract specific line from a string
Hi guys.
I?m starting to work with java...
i have the following data inside a string variable:
0 rows inserted.
0 rows updated.
0 rows ignored.
98 rows marked as deleted.
0 rows have no country.
3345 rows have no geo.
0 rows are invalid.
what i want to do i to extract the number of rows marked as delete.
I think that i figured out how to extract the number from this line :"98 rows marked as deleted."
but how do i get to that line?
I hope you can Help me. Thanks.the string is the result from a Function... this function gets the info from a store procedure...
rta = "Results for " + dh.getSource() + " source:\n" +
dh.getInsertedCount() + " rows inserted.\n" +
dh.getUpdatedCount() + " rows updated.\n" +
dh.getIgnoredCount() + " rows ignored.\n" +
dh.getDeletedCount() + " rows marked as deleted.\n" +
dh.getNoCtryCnt() + " rows have no country.\n" +
dh.getNoGeoCnt() + " rows have no geo.\n" +
dh.getInvalidCnt() + " rows are invalid.\n";
i can?t change this function...
so i need to work with the returned value...
i what thinking to use the following method to extract te number...
private int GetNumericValue(string sVal)
int iFirst, iCharVal, iEnd;
int iMult = 1, iRet = 0;
char[] aNumbers = "1234567890".ToCharArray();
iFirst = sVal.IndexOfAny(aNumbers);
iEnd = sVal.LastIndexOfAny(aNumbers);
if (iEnd < 0)
return 0;
string subStr = sVal.Substring(iFirst, iEnd - iFirst + 1);
iEnd = subStr.Length - 1;
while (subStr.Length > 0)
iCharVal = int.Parse(subStr[subStr.Length-1].ToString());
iRet += iMult * iCharVal;
iMult *= 10;
if (iEnd <= 0)
break;
subStr = subStr.Substring(0, subStr.Length - 1);
iEnd = subStr.LastIndexOfAny(aNumbers);
subStr = sVal.Substring(iFirst, iEnd + 1);
return iRet;
but i still need the 4rd line to extract the number -
How to create session id from different string controls
how to create session id from different string controls
fais,
Please create the VI you are talking about and save some default data into all of the controls. Also on the front panel, place the session ID that should be generated by that data. Now, post your VI to a response so I can download it. I can then take this VI and help you create the functionality. (Please post what version of LabVIEW you are using.)
My guess it that you are going to need to use a good number of string concatenations as well as a few string indexes to get parts of strings out. As for the date, you can use a Property node with the Numeric Text.Text property to get the actual string displayed on the front panel for the date and parse out the parts that you want.
Randy Hoskin
Applications Engineer
National Instruments
h
ttp://www.ni.com/ask -
How to output serial number from production order in GLM ?
how to pull serial number from production order in wwi template for GLM ?
Hi,
Please have a look to this thread:
BAPI/RFC to get serial numbers for a production order
Hope it helps,
Kr,
m. -
How to get a char from a String Class?
How to get a char from a String Class?
Use charAt(int index), like this for example:
String s = "Java";
char c = s.charAt(2);
System.out.println(c); -
How to calculate week number from system date
Hi experts,
how to calculate week number from system date ?
thanks.
SKhi,
The above FM can be used for BADI or customer exit, if it is design level then you can use formula as well, under formula date functions you can use DATE_TO_WEEK.
regards,
Arvind. -
How to find PO number from ORDRSP Idoc.
Hi,
Can anybody let me know how to find the PO number from the Idoc ORDRSP.
Scenario is as below:
SAP system1 will send PO to SAP system2.(Idoc type ORDRS05).
When SO is created in SAP system2, it will send a confirmatory Idoc of message type ORDRSP.
From this I have to find the PO number as I can find only VBLNR.
Points assured for workful solutions.
-B S BHi BSB,
CHECK THIS CODE
DATA : BEGIN OF itab_status OCCURS 0,
idoc LIKE edids-docnum,
date_stauus LIKE edids-logdat,
status_counter LIKE edids-countr,
status LIKE edids-status,
descrp(70),
ponumber LIKE ekpo-ebeln,
mess LIKE edidc-mestyp,
END OF itab_status.
DATA: text111 LIKE e1mbxyi.
DATA: text11 LIKE e1edp02.
IF itab_status-MESS = 'WMMBXY'.
select single * from edid4 INTO ITAB where segnam = 'E1MBXYI' AND
HLEVEL = '02' AND DOCNUM = itab_status-idoc.
MOVE : ITAB-SDATA TO TEXT111 ,
text111-EBELN TO itab_status-ponumber.
ELSE.
YOUR CASE FALLS IN THIS CATEGORY****
select single * from edid4 INTO ITAB where segnam = 'E1EDP02' AND
HLEVEL = '03' AND DOCNUM = itab_status-idoc.
MOVE : ITAB-SDATA TO TEXT11 ,
text11-BELNR TO itab_status-ponumber.
ENDIF.
endif.
LET ME KNOW IF YOU NEED ANYTHING ELSE.
THANKS
VENKI -
How to get page number from the PDF using Javascript
Hi,
We are having list of Single page PDF. The pdf are named in the order,
ISBN_Author_01.PDF (with real page number as i)
ISBN_Author_02.PDF (with real page number as ii)
ISBN_Author_03.PDF (with real page number as iii)
ISBN_Author_04.PDF (with real page number as 1)
ISBN_Author_05.PDF (with real page number as 2)
ISBN_Author_06.PDF (with real page number as 3)
ISBN_Author_nn.PDF (with real page number as 500)
Here each pdf has a page number and in sequential order.
The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
To do this task, I am writing a Javascript to get the real page number from the PDF.
Can anybody help me how to get the page number from the PDF using Javascript.
Thanks,
GopalThe "real" page number within a PDF is the count of the physical page starting at 0, zero.
pageNum numPages
The number printed on each page is the page label.
setPageLabels getPageLabel
You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional array of the file names and the page label for the page within that array. -
How can i store values from my String into Array
Hi guys
i wants to store all the values from my string into an array,,,, after converting them into intergers,,,, how i can do this becs i have a peice of code which just give me a value of a character at time,,,,charat(2)...BUT i want to the values from String to store in an Array
here is my peice of code which i m using for 1 char at time
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i>=tempci.length();i++)
int ascii = tempci.charAt(i); //Get ascii value for the first character.public class d1
public static final void main( String args[] )
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i<tempci.length();i++)
int ascii = tempci.charAt(i);
ExampleArray2=ascii;
for(int i=0;i<ExampleArray2.length;i++)
System.out.println(ExampleArray2[i]); -
How to remove serial number from a PC?
Hello,
I had previously activated some NI products on a PC using my serial number. Now, I'm transferring ownership of the PC to someone else, so I've deactivated the products. However, the serial number is still recorded somewhere in the PC: In the NI License Manager, when I select Activate -> Use a Web browser... it auto-fills the fields with my serial number.
How do I wipe this serial number from the PC?
Thanks!@uday: Yes, there are no more traces of the license files. I have NI License Manager 3.7. (But even though the license files are gone, my serial number remains)
@RavensFan: Because this is a brand new PC which forms part of a product I developed for a customer. I activated the Development versions of LabVIEW and TestStand for debugging purposes, just like this guy 5 years ago. Now I want to ship the system to the customer with LabVIEW RTE and the TestStand Base Deployment License in place, without undoing and redoing the work I've done on it.
Well, suppose I completely uninstall all NI software. I get the impression that if my customer decides to install their own copy of NI software on this PC, the first thing they'll see in the activation wizard is my serial number, which is stored somewhere in the PC. I'd like to find out where the serial number is stored, so that I can wipe it. -
Can anyone tell me how to block a number from contacting me on my iphone please?
Please can you help?
I am getting nuisance texts from a person & i dont want to have to change my phone number. My network provider says they cant help me but that it is possible with the iphone to block a certain number from texting/phoning me. I cant figure out how to do it though? please can anyoe help?
many thanks!!If you have AT&T you can call them and put Manage Smart Limits on your account and then you can log on your account and put the number you want blocked. Not sure about the iPhone having a app to do this, cell phone calls and texts come through your network and it is your network that has to bock unwanted numbers.
-
How to block a number from calling
How do I block a specific number from calling my phone? I have a 4S
Press the ⓘ to the right of the call in the Recents section in the Phone app. Scroll to the bottom and use "Block this Caller".
-
How to delete a number from imessage
I have deleted a number from my contacts and its still showing up on my imessage.How can i delete this number?
Hi,
You can disable a "Receive At" item which will in turn remove it from the "Start new conversation from" drop down in the Messages app across Mountain Lion and Mavericks.
You can remove it from the iPhone or other iOS device.
However this will not remove it on either Messages 7.x.x (Mountain Lion) or Messages 8 (Mavericks)
In Mavericks you have to delete the .plist involved to remove the Aliases you don't want (and tend to have to re-enter the Apple ID as well)
With a Finder window Open, use the Go Menu whilst holding down the ALT key.
Select the Library that now appears in the menu list.
Navigate to Preferences.
Find com.apple.ids.service.com.apple.madrid.plist and drag it to the Trash
Restart the Messages app
8:50 pm Monday; April 7, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
How to get week number from date
Hi,
please mention how to get the number of week from a particular date using fn module?Hi Debarshi,
Use FM <b>DATE_GET_WEEK</b>
Reward points if helpful.
Regards,
Hemant
Maybe you are looking for
-
How to hide warning messges in a program?
how to hide warning messges in a program?
-
Long text not displayed in outpur of adhoc query
Hi, I am trying to run an ad hoc query in which i need the Org unit long text in the output. When i run i only see the short text of the Org unit.I tried changing the output display option as 'Value and text' and 'text' both but it shows the short te
-
How can i find out the balance of a itunes gift card without redeeming it?
How can i find out the balance of a itunes gift card without redeeming it??
-
RAID card battery conditioning - "Battery failed (other than expired)"
OK, so if you log-in using the GUI, you get a warning telling you that battery conditioning is happening and that you shouldn't the server. However, if you log-in over SSH, as you might, for instance, with a headless Xserve, you don't get that warnin
-
I have a few pages on my site with slide shows on them. One of the pages shows the pictures about 1/4 size inside the viewer frame. I have checked the low resolution shots loaded and they are the same as the other page photos. I have checked the sett