Need help in the String Format method

really need help in string.Format method. I would like to show the s in two digit numbers.
for example:
if s is below 10 then display *0s*
the expecting result is 01,02,03.. 09,10,11....
I tried this method, somehow i got the errors msg. pls advise. thx.
public void setDisplay(String s) {
String tmpSS=String.format("%02d",s);
this.ss.setText(tmpSS);
Edited by: bluesailormoon on May 19, 2008 10:30 AM

Apparently, you expect the string to consist of one or two digits. If that's true, you could do this:String tmpSS = (s.length() == 1) ? ("0" + s) : s; or this: String tmpSS = String.format("%02d", Integer.parseInt(s));

Similar Messages

  • Need help finding the default payment method for supplier site in R12

    I am using the following query to find out what the default payment method is for a supplier site.
    select pv.vendor_id ,
    pvs.vendor_site_id,
    iepa.ext_payee_id,
    ieppm.payment_method_code
    from ap_supplier_sites_all pvs
    ,ap_suppliers pv
    ,iby_external_payees_all iepa
    ,iby_ext_party_pmt_mthds ieppm
    where pv.pay_group_lookup_code = 'EMPLOYEE'
    and pv.vendor_type_lookup_code = 'EMPLOYEE'
    and pv.employee_id is not null
    and pv.employee_id =92584--p_person_id
    and pv.vendor_id= pvs.vendor_id
    and pvs.vendor_site_code = 'HOME'
    and pvs.pay_group_lookup_code <> 'ATTACHMENT'
    and ((pv.end_date_active is null) or (pv.end_date_active >= sysdate))
    and ((pvs.inactive_date is null) or (pvs.inactive_date>= sysdate))
    and pvs.pay_site_flag = 'Y'
    and pvs.vendor_site_id = iepa.supplier_site_id
    and iepa.ext_payee_id = ieppm.ext_pmt_party_id
    and ieppm.primary_flag = 'Y'
    and pv.segment1 = '131678'
    The problem is that I am returning two rows.
    I have gone in to the application and changed the default payment method from 'Check' to 'Electronic' and I am able to see the change on one of the records, however I am unable to determine how I'm supposed to narrow it down to just this record. I am pulling what hair I have left out!
    Please help.
    Chris

    Here is the generic query for some one who is faing problem like us.This query will return all the payment methods for all sites of a supplier
    SELECT ieppm.payment_method_code,ieppm.inactive_date
    FROM ap_supplier_sites_all assa,
    ap_suppliers ass,
    iby_external_payees_all iepa,
    iby_ext_party_pmt_mthds ieppm
    WHERE ass.vendor_id = assa.vendor_id
    AND assa.pay_site_flag = 'Y'
    AND assa.vendor_site_id = iepa.supplier_site_id
    AND iepa.ext_payee_id = ieppm.ext_pmt_party_id
    AND ass.segment1 = '10033' -- Supplier Number
    AND( (ieppm.inactive_date IS NULL)or (ieppm.inactive_date > sysdate)) ;

  • Need help in converting date format

    Hi,
    Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
    Thanks,
    Raj.

    I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
    Edited by: user11165753 on 7-dec-2009 23:50

  • I need help with the Quote applet.

    Hey all,
    I need help with the Quote applet. I downloaded it and encoded it in the following html code:
    <html>
    <head>
    <title>Part 2</title>
    </head>
    <body>
    <applet      codebase="/demo/quote/classes" code="/demo/quote/JavaQuote.class"
    width="300" height="125" >
    <param      name="bgcolor"      value="ffffff">
    <param      name="bheight"      value="10">
    <param      name="bwidth"      value="10">
    <param      name="delay"      value="1000">
    <param      name="fontname"      value="TimesRoman">
    <param      name="fontsize"      value="14">
    <param      name="link"      value="http://java.sun.com/events/jibe/index.html">
    <param      name="number"      value="3">
    <param      name="quote0"      value="Living next to you is in some ways like sleeping with an elephant. No matter how friendly and even-tempered is the beast, one is affected by every twitch and grunt.|- Pierre Elliot Trudeau|000000|ffffff|7">
    <param      name="quote1"      value="Simplicity is key. Our customers need no special technology to enjoy our services. Because of Java, just about the entire world can come to PlayStar.|- PlayStar Corporation|000000|ffffff|7">
    <param      name="quote2"      value="The ubiquity of the Internet is virtually wasted without a platform which allows applications to utilize the reach of Internet to write ubiquitous applications! That's where Java comes into the picture for us.|- NetAccent|000000|ffffff|7">
    <param      name="space"      value="20">
    </applet>
    </body>
    </html>When I previewed it in Netscape Navigator, a box with a red X appeared, and this appeared in the console when I opened it:
    load: class /demo/quote/JavaQuote.class not found.
    java.lang.ClassNotFoundException: .demo.quote.JavaQuote.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: \demo\quote\JavaQuote\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Exception in thread "Thread-4" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)What went wrong? and how can I make it run correct?
    Thanks,
    Nathan Pinno

    JavaQuote.class is not where your HTML says it is. That is at the relative URL "/demo/quote/".

  • Need help about the SHA Message Digest ? & what is use of Message Diagest ?

    need help about the SHA Message Digest ? & what is use of Message Diagest ?
    1>i have one program of making message digest
    2>which requires two files name
    3>one for input like txt
    4> second is out put file of message digest
    can any one tell what is the use of second generated file .

    MessageDigest md = MessageDigest.getInstance("SHA");
    FileInputStream fis = new FileInputStream(args[0]);
    byte[] b = new byte[1024];
    int readed = -1;
    while((readed = fis.read(b)) > 0)
         md.update(b, 0, readed);
    fis.close();
    FileOutputStream fos = new FileOutputStream(args[1]);
    byte[] d = md.digest();
    StringBuffer sb = new StringBuffer();
    for(int i = 0; i < d.length; i++) {
         String str = Integer.toHexString(d[i] & 0xff);
         sb.append(str.length() < 2 ? "0" + str : str);
    fos.write(sb.toString().getBytes());
    fos.close();

  • I need Help with the dynamic link feature in CS3

    Hi I was wondering if anyone could help me with an issue I am having? I have the adobe cs3 master collection. Having watched tutorials on the dynamic link feature my version seems not to have the same options as those I have viewed. I wish to send my premiere video creation to encore using dynamic link, however when I click "file" and then "adobe dynamic link" the only options available are about "adobe after effects". I can export to encore however I am only alloowed to export one premiere sequence to one new encore file, I cannot create an encore file and import several premiere sequence into the same encore project. That means currently I can only have an encore creation with one premiere sequence in it, and I have no adobe dynamic link. Any help anyone could offer would be greatly appreciated.

    Thanks very much for that guys but my premiere media encoder only lets me export as: MPEG1, MPEG1-VCD, MPEG2, MPEG2 blu-ray, MPEG2-DVD, MPEG2-SVCD, H.264, H.264 blu-ray, Adobe Flash Video, Quicktime, Real Media, Windows Media. Are any of these formats DV AVI?
    Am I to export my videos direct to encore or save them elsewhere (e.g desktop). It seems that I cannot export sequences from different premiere projects to the same encore project.
    Sorry if any of these questions seem obvious, I am just new to premiere and keen to do things right from the off.
    Many thanks again guys.
    Date: Tue, 24 Nov 2009 19:32:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: I need Help with the dynamic link feature in CS3
    Harm is correct.  For SD DVD, exporting as a DV AVI file from Pr will give you good results.  Encore's Automatic Transcoding will give you maximum quality for the available disc space.
    -Jeff
    >

  • I just created an iCloud email and I want to use that email for my iTunes account as well. I need help suiting the old apple I'd because I do not remember anything associated with that email and I don't know the security questions

    I just created an iCloud email and I want to use that email for my iTunes account as well. I need help switching the old apple ID because I do not remember anything associated with that email and I don't know the security questions or the login for that old email.

    You cannot do that.  The AppleID you used to create the iCloud account is an active primary email address.  The email address you created with the iCloud account is also an active primary email address (all Apple domain email address automatically become AppleIDs as well).  You cannot replace the primary email address on one active AppleID with the primary email address on another, active AppleID.
    You can use your iCloud email/AppleID with iTunes, but it will be a separate account, so all your previous purchases remain tied to the other AppleID you have.
    I don't understand your statement that you could not remeber your old AppleID password, as you would have had to use it to create the iCloud account in the first place (the first step of creating the iCloud account required you to login with your existing AppleID and password)?

  • Need help with the Vibrance adjustment in Photoshop CC 2014.

    Need help with the Vibrance adjustment in Photoshop CC 2014.
    Anytime I select Vibrance to adjust the color of an image. The whole image turns Pink in the highlights when the slider is moved from "0" to - or + in value.  Can the Vibrance tool be reset to prevent this from happening? When this happens I cn not make adjustments...just turns Pink.
    Thanks,
    GD

    Thank you for your reply. 
    Yes, that does reset to “0” and the Pink does disappear.
    But as soon as I move the slider +1 or -1 or higher the image turns Pink in all of the highlights again, rather than adjusting the overall color.
    GD
    Guy Diehl  web: www.guydiehl.com | email: [email protected]

  • I need help with the iPad Remote app to connect to apple TV 2

    I need help with the iPad Remote app to connect to apple TV 2 I have the app already on my ipad and when I open it only shows my itunes library and not the small black Apple TV 2 icon! How do i fix this and i know it's something 

    Get the manual at http://manuals.info.apple.com/en_US/AppleTV_SetupGuide.pdf
     Cheers, Tom

  • Need help accessing the router web page.  I have been tol...

    Need help accessing the router web page.  I have been told my router is acting like a switch and the IP address is not in the proper range.  I have tried reseting the router (hold for 30 sec and unplug for 5 mins).  Didn't work.
    thanks

    What router are you using?  Almost all Linksys routers use 192.168.1.1 as the default local IP address, but there is at least one that uses 192.168.16.1 , namely the WTR54GS  (not the WRT54GS).
    You need to try again to reset the router to factory defaults.
    To reset your router to factory defaults, use the following procedure:
    1) Power down all computers, the router, and the modem, and unplug them from the wall.
    2) Disconnect all wires from the router.
    3) Power up the router and allow it to fully boot (1-2 minutes).
    4) Press and hold the reset button for 30 seconds, then release it, then let the router reset and reboot (2-3 minutes).
    5) Power down the router.
    6) Connect one computer by wire to port 1 on the router (NOT to the internet port).
    7) Power up the router and allow it to fully boot (1-2 minutes).
    8) Power up the computer (if the computer has a wireless card, make sure it is off).
    9) Try to ping the router. To do this, click the "Start" button > All Programs > Accessories > Command Prompt. A black DOS box will appear. Enter the following: "ping 192.168.1.1" (no quotes), and hit the Enter key. You will see 3 or 4 lines that start either with "Reply from ... " or "Request timed out." If you see "Reply from ...", your computer has found your router.
    10) Open your browser and point it to 192.168.1.1. This will take you to your router's login page. Leave the user name blank (note: a few Linksys routers have a default user name of "admin" (with no quotes)), and in the password field, enter "admin" (with no quotes). This will take you to your router setup page. Note the version number of your firmware (usually listed near upper right corner of screen). Exit your browser.
    If you get this far without problems, try the setup disk (or setup the router manually, if you prefer), and see if you can get your router setup and working.
    If you cannot get "Reply from ..." in step 9 above, your router is dead.
    If you get a reply in step 9, but cannot complete step 10, then either your router is dead or the firmware is corrupt. In this case, use the Linksys tftp.exe program to try to reload your router with the latest firmware. After reloading the firmware, repeat the above procedure starting with step 1.
    If you need additional help, please state your ISP, the make and model of your modem, your router's firmware version, and the results of steps 9 and 10. Also, if you get any error messages, copy them exactly and report back.
    Please let me know how things turn out for you.
    Message Edited by toomanydonuts on 01-21-2008 04:40 AM

  • I need help proving the date tag on a photo stored in my iPhoto is from the date it was sent to my iphone/date it was imported into iphoto - and that it is NOT the date the photo was actually taken.  Please help!

    I need help proving the date tag on a photo stored in my iPhoto is from the date it was sent to my iphone/date it was imported into iphoto - and that it is NOT the date the photo was actually taken.   I recieved a photo via text on my iphone and then I synced my iphone to my macbook and now it is in iphoto.  I already know that the date on the photo per the tag that shows up on it in iphoto is NOT the date the photo was actually taken.  I need article or literature or something confirming the tag is from when it was sent to the iphone and/or when it was imported.  I greatly appreciate some assistance!

    All I am trying to do is find something on a forum board or article etc stating that the the date showing in iphoto could be the date it was imported or synced or sent to me and not the actual date taken.
    The date on the photo could be anything because you can edit the date with iPhoto or any of 100 apps, free and paid for. So, the date on the photo will prove nothing, I'm afraid.
    Regards
    TD

  • Need help for the $200 promo rebate for trade-in of I Phone 4

    Need help for the $200 promo rebate for trade-in of I Phone 4.  Unable to preregister when I ordered the new 6  in September.  Now can not contact VZW recycle program regarding.

    When I ordered my phone on Sept. 13th in a Verizon store, I had to ask the salesman how I went about getting the $200 rebate. He said shipping materials would come with the new phones. When I received the confirmation e-mail of my order, it contained a link for the rebate. Fortunately I clicked on the link, filled out the form online, and received the packing materials to send my phone in shortly after. My phones came in on Oct. 14th and I sent 3 of them back. So far I have received a gift card for $200 for 2 of the phones; the other is showing not received. I don't know what your situation is, but I think the promotion ended Oct. 15th. If I had listened to the salesman I think I would be out of luck as well. I hope I am wrong for your sake.

  • I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    Freezing, or crashing?
    ID on the Mac can produce reports that may (or may not) prove helpful in diagnosing the problem. I suspect this is something not directly related to InDesign, and maybe not to any of the Adobe apps directly since you seem to be having a problem in more than one. That often inidcates a problem at the system level.
    Nevertheless, it won't hurt to try to gather the reports. You'll find driections for how to generate them, and to post them on Pastebin.com (then put a link to them here) so we can see what's going on at Adobe Forums: InDesign CS5.5 Not Responding
    Do you happen to run a font manager? If so, which one, and waht version?

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Need help in handling string of characters

    Hi,
    I am trying to scan string and separate different text based on business logic. For example:
    String = 'My bus comes at 999 F Street at 8 am'
    Now I need to scan the string and break the sentence into multiple words like:
    - First occurrence of number which is 999 goes into var1 variable.
    - Last occurrence of number which is 8 goes into var2 variable.
    I am wondering if this can be achieve with regular expression of any oracle internal function.
    Thanks,
    Edited by: skas on Jun 6, 2013 10:34 PM

    nkvkashyap wrote:
    or you can even try like this...
    with data(str) as
    (select 'My bus comes at 999 F Street at 8 am' from dual),
    data1 as
    (select regexp_replace(str, '[^[:digit:]]+', ' ') a from data)
    select regexp_substr(a,'[^ ]+',1,1) var1,regexp_substr(a,'[^ ]+',1,2) var2 from data1;
    Output:
    var1         var2
    999     8
    No need to make this complicated ;)
    SQL> with data(str) as
      2  (
      3   select 'My bus comes at 999 F Street at 8 am'
      4   from dual
      5  )
      6  select     regexp_sUBsTR(str, '\d+') VAR1,
      7     regexp_sUBSTR(str, '\d+',1,2) VAR2
      8  from data;
    VAR V
    999 8Edited by: jeneesh on Jun 7, 2013 11:11 AM
    Missed David's post.. This is the same as his post..

Maybe you are looking for

  • Getting video from DVD

    I have used a VCR Player/DVD recorder to transfer files from old family VHS tapes to DVD. After finalizing these DVD-R disks, I wanted to take them to my Mac and further edit them with iMovie or iDVD, however, the Mac will only play them with DVD Pla

  • On powering up I got a message date and time were changed to before 2008. Why would this happen?

    I used the computer this morning to check email.  Shut it down and powered back up this afternoon and a box appeared telling me the date and time were set for before 2008 (actually for 12/31/2000) and needed to be reset.  Why would this happen?

  • ZyXEL iChat connection problem solved with updated firmware

    Hi, bought a new ADSL modem (ZyXEL Prestige 660H-61) and was unable to do video iChat with one particular person. She was/is using ZyXEL modem as well. Tried every setting with no success and noticed, when trying to find solution here, that other peo

  • Can't update iTunes movie info when sharing media server

    I use a mac mini as a media server and have a 2T hard drive connected to it with all my movies and TV shows. It is connected to my network but not to a monitor.  I connect to it thur sharing when I want to make a change on it.  I have always been abl

  • Why can't thunderbird find my email accounts

    I open up Thunderbird and it asks me if I want to create an account. I have two existing accounts that access my mail on Time Warner Cable's Webmail. One is PAWilkey and the other is Tx7Phyl. I had 100's of emails in these two accounts. Thunderbird s