Problem with pattern

Hi.
I'm trying to apply to float value pattern:
<%
String pattern = "0.00";
java.text.DecimalFormat currency_formatter = new java.text.DecimalFormat(pattern);
%>
<%=currency_formatter.format(rs.getFloat("lalalala"))%>
but it returns value like this 23434,23 not 23434.23. I'm running windows 2000 server.
thanks in advance

hi,
The follwing code will help u .
I also hope that u understood it.
import java.text.DecimalFormat;
import java.util.Locale;
public class DecimalFormat1 {
public static void main(String args[]) {
// get format for default locale
Locale.setDefault(Locale.GERMANY);//whatever you want ,that country will be set
//(e.g) Locale.CHINA ,Locale.US ....
System.out.println("Locale :: " + Locale.getDefault());
String df = "0.000";
DecimalFormat df1 = new DecimalFormat(df);
System.out.println("Decimal ::" +df1.format(1234.56));

Similar Messages

  • Problem with pattern numeric field

    Hi All.
    I tryed to format numeric field with patterns num{zzzzzzzzzzzzzzzzzzz9} or num{99999999999999999999}. But when I enter 20 numeric characters like 12345678901234567890 as a result I got 12345678901234567000. How fix that problem?
    Thanks.

    The result you're getting is correct, because you pattern only allows a period to separate the decimal places.
    Try the following edit pattern:
    num{zzzzzzzzzzz9,99}|num{zzzzzzzzzzz9.99}
    and this display pattern:
    num{zzz.zzz.zzz.zz9,99}

  • Hi ya'll, I'm having problems with patterns. Error 519, what's going on?? URGENT!!! Can't seem to fill layers with user defined patterns

    I've never had this problem before, I noticed improvements a few days ago regarding pattern tool but the last few days I've been unable to fill layers with a user defined pattern. This is one of the main reasons I use photoshop and it's giving me a headache!!! I have to turn in some patterns by monday and this is not working, please fix it!!

    First a clarification:  You are NOT addressing Adobe here in these user forums.
    BOILERPLATE TEXT:
    Note that because this is boilerplate text, not all points may apply to any given, specific poster.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Problem with Pattern Matching

    Hello,  I am using Vision Development Module 8.5 with VB6.   I need immediate help on coming up with a solution for an auto warranty return for incomplete "Fog Lamp" indicator symbol.  I use a match score minumum of 900, but the match score returns a 932.  I don't see how a score > 900 is returned for so much missing from this symbol.  I use this test in a high production line and am very concerned.  I attached a Vision Assistant 8.5 script and actual image from auto warranty return.  The *.png template used for comparison is also in zip file.
    Thanks
    Attachments:
    PatternMatchScrpt-FogLamp.scr ‏2 KB
    Images.zip ‏137 KB

    Golden Template does exist in 8.5, and that was my first idea too, however, after trying it, it might not be the best algorithm for it.
    Golden Template compare the contour of objects, and they don't produce very good result in the specific image because the symbols are relatively small and not contrasted enough once we look at the luminance plane (i.e. we can't perform a great contour extraction).
    What I tried and works decently is the looking at the identification score of the classification algorithm.
    The only drawback of this method is that the object needs to be whole (i.e you might need to do a little morphology to close the objects). But the identification score will be quite different on the partial fog lamp.
    Another tactic, which is similar to the previous one is to (mis)use the OCR algorithm to train the object and use the character verification function (i.e. define a perfect fog lamp image (character) as the reference character when you train the OCR engine.
    The algorithm will them return a verification score which will tell you how far or close the pattern under inspection is from the reference one defined in the OCR file. OCR is based on classification.
    After trying that on your image, the verification score is different enough and you could use that for making a decision, but the difference is not as marked as with using the identification score of the classification algorithm.
    Both algorithms are based on thresholding the image. One advantage of using the OCR is that you can tweak the min character spacing parameter to adjust the segmentation so that the symbol is considered one full object (as opposed to having to perform morphology to do it if you use the classification algorithm).
    As I mentioned, classification seems to give you a better differentiation between the scores.
    Both methods allow you to define a Classification file or Character Set File that allow you to test multiple symbols.
    I am attaching a couple inspections and files I used to do this quick test.
    Hope this helps.
    Best regards,
    Christophe
    Attachments:
    Fog Lamp Inspection.zip ‏156 KB

  • Having Problems with "pattern" in Spry Validation Text Field

    Hi, thanks for reading. I have read the primers and docs on
    using the "custom" pattern ability of the spry textfield validion.
    However, I am unable to fully understand how to implement the
    conditions I desire. I have read that you use:
    "B"; "b" for Case-insensitive alphabetic characters.
    I suppose my first question is, does that mean either B or b
    will work?
    What I am trying to accomplish for my first validation is:
    1- to allow between 1 and 15 characters to be entered. They
    should be only a) alphanumeric (number or letter) b) they MAY
    contain a space in there and c) the first character needs to be a
    letter. So, what I want it to scrub for is a char string no longer
    than 15 chars, number or letter (may contain a space, but that
    counts towards the 15) and the first char must be a letter.
    I have been playing around with the attributes:
    ("spryCustomtest", "custom", {validateOn:["blur"],
    minChars:1, maxChars:15, pattern:"a"});
    however, i am unable to see how to specify the pattern so
    that it allows for 1-15 chars and insists that only the first char
    is a letter......
    My second question is, how could I implement a field for
    heightened password-choosing rules....
    perhaps tell it to allow for:
    a) minimum of 8 characters
    b) at least one capital letter
    c) at least one special character or number
    d) maximum of 30 characters
    thanks for any help, Tex

    Did you ever find a solution for this?

  • Problem with pattern fills

    I have a black and white pattern fill (black dots on a white background). When I fill objects with it and put a sheet color behind them, sometimes the fill is translucent (meaning the color shows where the white is supposed to), but sometimes it is correctly opaque. I've tried filling the translucent objects with the opaque fills with no success. Any ideas??

    HOw do you generate the color behind the object?
    is it a rectangle filled with the color?
    if so, check if the pattern object is set to multiply , see transparency panel.

  • Problems with pattern matching Regular expression

    String emailRegEx = "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*";
    String test = "[email protected]";
    if(test.matches(emailRegEx)) {
    }throws an exception
    java.util.regex.PatternSyntaxException: Illegal repetition near index 5.

    It works fine for me.

  • Problem with SimepleDateFormat for the military pattern....

    i have the code, which has to display date in the military format i.e., "yyyyMMddhhmm".
    java.util.Date date = new SimpleDateFormat("yyyyMMddhhmm").parse("200709201700");
    System.out.println("Expected Date : " + date);
    but output displays everytime i.e., Thu Sep 20 17:00:00 IST 2007
    is there any problem with the pattern???

    By military format you mean 24 hour clock time, right? I believe "hh" in SimpleDateFormat is for 12 hour clock time and "HH" is for 2 digits of 24 hour clock time.
    EDIT: Also, you're just parsing the string into a Date object. When you're printing, it'll simply use the toString() for Date, giving you an output as you see. If you want the output also to be formatted in the same way, you need to use the format() method of SimpleDateFormat with the same pattern on the Date.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    Edited by: nogoodatcoding on Oct 3, 2007 6:03 PM

  • Problem with date pattern

    Hi all,
    I have a little maddening problem with oracle.jbo.domain.Date.
    I have a viewObject with an attribute (fechaCompra) type Date and I need the time too so in controlHints I have defined:
    format type: Simple Date
    Format: yyyy-MM-dd 'at' hh:mm:ss
    Right, on runTime now i see ok the data and in the inputDate appears the calendar and the hour .
    But when I take the value of this attribute, to call a void that takes a oracle.jbo.domain.Date type, raises an error when parses the value of the atribute.
    All this doesn't happen when in the view object the controlHints are defined like this:
    format type: Simple Date
    Format: yyyy-MM-dd
    Any idea?
    Thanks in advance,
    Rowan

    hello,
    My guess would be that when you drop your formatted date into the methode the parse function is called from String to date, this work with no time attached.
    But fails with the time attached. I would double check the specific class you pass to each method to be sure they are correct.
    hat you mention parse gives an even bigger hint that you are using the parse function from oracle.jbo.domain.Date, which takes a string.
    This function will fail with your custom patterns.
    //get the value
    String value = .....
    //Not 100% sure if the at needs to be escaped or not
    DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd at hh:mm:ss");
    //Prolly needs a try catch, writing this by hand
    java.util.Date utilDate = sdf.parse(value);
    java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
    oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
    //pass to your method-Anton

  • Irritating problem with Retina Display; dims/ flickers on and off and in weird pattern along bottom of screen

    I bought a 13-inch Retina MBP in late September 2014, just a few months ago and i am starting to have problems with the screen.
    First of all, the screen will sometimes fade and a weird pattern will appear at the bottom of the screen in which every second set of backlights is off and the other is on.  Here is a picture that i found on the internet; from a much older mac though but still shows the problem.
    The second problem, which is more irritating, is that every now and again the screen will sort of flicker where it will get darker then lighter and keep switching the brightness in a matter of seconds.  This is so hard to look at!!
    Hopefully there is an easy solution however i may have to take it to an Apple store and unfortunately get it replaced.
    Thanks.

    Howdy there chappo_10,
    It sounds like you have a couple of unexpected video issues on your 13 inch MacBook Pro. I'd like to recommend these troubleshooting steps specifically to hep you determine if you need to take it to the Apple Store:
    Apple computers: Troubleshooting issues with video on internal or external displays
    Reset the system
    You can reset the Mac's parameter RAM and SMC. 
    Reset the resolution
    Start by resetting the Mac's parameter RAM. If the display does not come up, was previously set to an unsupported resolution, and still results in no video:
    Start up in Safe Mode.
    From the Apple () menu, choose System Preferences.
    Choose Displays from the View menu to open the preferences pane.
    Select any resolution and refresh rate that your display supports.
    Restart your computer.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Design flaw in overloading? Problem with visitor pattern

    I have been trying some implementations of the Visitor pattern in Java and have encountered a problem with overloaded methods in Java. It seems that the caller (client) of a overloaded method decides what implementation of that method is chosen. I find that strange from an OO / encapsulation point of view and it gets me into problems when using Visitor. This code shows my problem:
    // a class with overloaded methods
    public class OverLoadingTest {
         public void print(String s) {
              System.out.println("This looks like a String to me:");
              System.out.println("\"" + s + "\"");
         public void print(Object o) {
              System.out.println("This looks like an Object to me:");
              System.out.println("\"" + o + "\"");
    //a client for that class
    public class OverLoadingTestClient {
         public void test() {
              OverLoadingTest test = new OverLoadingTest();
              Object o1 = "String in an Object reference";
              String s1 = "String in a String reference";
              test.print(o1);
              test.print(s1);
         public static void main(String[] args) {
              new OverLoadingTestClient().test();
    //And the output is:
    This looks like an Object to me:
    "String in an Object reference"
    This looks like a String to me:
    "String in a String reference"
    //The output I would have expeced (wanted):
    This looks like a String to me: //it is a String!
    "String in an Object reference"
    This looks like a String to me:
    "String in a String reference"
    Why is this? Is there a work around?

    The specific method is decided on in compile time and by the client of that method, not the provider. I'd expect the client to just invoke the method and let the privider figure out what implementation to choose. Whatever the client thinks that he is providing as argument types.
    I am implementing a slightly different version compared to http://ootips.org/visitor-pattern.html. I find implementing "v.visit(this);" for every subclass of the Visisted superclass strange. Why an abstract method "accept(Visitor v);" when all subclasses will iplement it in the same way ("v.visit(this);")?
    Daan

  • EEM Applet Problem With: event syslog pattern ".*" priority 2

    I went to create a EEM applet that would be invoked whenever any syslog message of priority 0-2 was invoked. I figured  the following event statement would work
           event syslog pattern ".*" priority 2
    I never really used the priority optional argument before but thought I understood from the docs that messages at or numerically lower than the specified level are matched.
    Well it doesn't seem to work as documented.  Seems to me that only messages at the specified level are beng matched and not messages numerically lower than the specified level.
    Anyway I did what I wanted differently but wanted to post this in case this is a bug in the syslog ed.

    Actually, it's a problem with the documentation.  The priority option only matches the specified severity.  What you could do is adjust pattern to do this:
    event syslog pattern "*-[012]-"

  • Problems with Factory pattern

    Sorry... I know this topic has been done to death but I still have some questions.
    In my development, I keep encountering a recurring problem that I believe should be solved by the 'factory pattern'. (Note: I'm not a patterns nut so I am only guessing about the correct pattern).
    Here is the problem:
    I develop an abstract base class. I extend the base class with several subclasses. Exterior objects use the instances via a base class reference and I don't want to them to have to know which is the correct subclass or how to create the instance.
    My solution is to make a create(param, param,...) method in the base class and using the param(s) construct the instance something like:static Foo create(int type)
    Foo instance = null;
    String className = "com.myco.foos.DefaultFoo";
    if(CONST_A == type)
      className = "com.myco.foos.FooA";
    else if(CONST_B == type)
      className = "com.myco.foos.FooB";
    {on and on...}
    {using reflection create a new instance from the className String}
    return instance;
    }The obvious problem with the create() method is that it becomes a maintenence point and I don't like the idea of a base class knowing about subclasses.
    Anyone know better a solution? Comments?
    Thanks in advance.

    Yes, that is the Factory pattern you describe. The client programs are going to call your createFoo() method and get back an instance of a subclass of Foo. Typically this pattern is used where there is some external entity that determines what subclass will be returned -- for example a system property -- and the client programs call createFoo() with no arguments. In this case reflection is used to create the instance, and your base class does not need to know anything about any subclasses.
    However, if your client programs can influence the choice of subclass, then they will have to pass some kind of parameter into createFoo(). At this point, createFoo() requires some decision logic that says "create this, or that, depending on the input parameter". And if that parameter is simply a code that enables the client programs to say "Give me a ChocolateFoo instance", then returning "new ChocolateFoo()" is the most straightforward design. But in this case, why can't the client program do that?
    If you don't like the base class having to know about subclasses (and you shouldn't be happy if it does), then you could have a helper class -- FooFactory -- that contains only the static method createFoo(). This class would know about Foo, and about any of its subclasses that it can produce instances of. It's still a maintenance point, no avoiding that, but at least it is off by itself somewhere.

  • Problem with phonenumber pattern

    Hello,
    I've got a problem with my display and validation pattern for my phone numbers.
    In Holland we have two sorts of phone numbers:
    Always 10 numbers, but some regions have a 3 digit area code,
    other regions a 4 digit area code.
    Example:
    012-3456789
    0123-456789
    This is also the way I want my users to enter the data.
    I want to display them as followed:
    012-3456789 --> 012 - 345 67 89
    0123-456789 --> 0123 - 456 789
    My display pattern right now is: text{999 - 999 99 99}|text{9999 - 999 999}
    My edit pattern is: text{999-9999999}|text{9999-999999}
    My validation pattern is: text{999-9999999}|text{9999-999999}
    (With a pop-up message to fill in 10 numbers, area code seperated from the rest by a dash, as in the example)
    The problem is that the validation works fine, but it always transforms the phonenumber to the first option (999 - 999 99 99).
    How can I fix this?
    Greetings and thanks in advance,
    Sterre

    Hi Veloki,
    You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.
    // Validate the email address.
    var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.
    // Set the regular expression to look for an email address in general form.
    var result = r.test(this.rawValue); // Test the rawValue of the current object to see
    // if it fits the general form of an email address.
    if (result == true) // If it fits the general form,
    true; // all is well.
    else // Otherwise,
    false; // fail the validation.
    Asiye

  • Problem printing patterns with Adobe Reader 9

    Hello all
    We have a mix environment of Windows 7/Vista with Adobe Reader 9.2 and Windows XP/2k with Adobe Reader 8.1.7. Documents including charts with patterns created with the option Save as PDF from Word 2007(SP2) look and print fine with Adobe Reader 8, but the same documents look and print the patterns a lot more compressed with Adobe Reader 9. All computers print to the same printers with the same print drivers (a windows print server). Attached is a sample PDF file. I've installed Adobe Reader 9.2 also on Win2k and WinXP computers with the same results, so the problem doesn't come from the OS.
    Any idea on what's wrong with Adobe Reader 9? Is it a configuration problem or defaults changed in Adobe Reader 9?
    Thanks in advance.

    You need to use Adobe Acrobat; Adobe Reader does not support editing.
    -vaibhav

Maybe you are looking for

  • IPhone 6 Wifi and Blutooth not working after update!

    I updated my iPhone 6 this weekend and did not back it up before doing so.  I now notice that my WiFi and Bluetooth are off and not working! I can't turn the back on.  I reset the phone, I even reset all the network settings, but can not turn them on

  • Unable to install Adobe Flash Player in iMAC with OS X10.7.2 Any suggestions?

    Unable to install Adobe Flash Player iniMAC with OS X 10.7.2 Lion. Any suggestions?

  • How to do document offset in Simple Plain to XML for Zip file Sender side

    Hi, Scenario is .zip file to IDOC, A idoc per a record. .Zip file has simple Plain structure like below. Tab delimiter. Name  number   code   country   Rating  Item ABC    123        C4        IND           I2        PRD ABD    123        C4        I

  • Save number to file

    I need save a 3D array to file.What i do is to change every three number to string and save.But i does't work.Can someone suggest ideal solution. Regards

  • Widget creation in Captivate 4 (combobox)

    Just download the trial version in hope of augmenting our screen designs prior to build the application. Currently I am using the ComboBox widget to simulate dropdown menus, but for longer menus the widget gets distorted. My thought was to create a n