Locale Formatting question

Locale Formatting question
In the preceding code the number 50 represent currency.
The output of NumberFormat is 50 with the local symbol
The output of DecimalFormat is 50.00 without the local symbol
The question is how to show 50.00 with the local symbol ???
import java.text.*;
import java.math.BigDecimal;
public class LocalFormating {
public static void main(String[] args) {
NumberFormat nf = NumberFormat.getCurrencyInstance();
DecimalFormat decfs = new DecimalFormat("#,##0.00");
BigDecimal anumb = new BigDecimal(50);
String temp = nf.format(anumb);
System.out.println("local anumb = " +temp);
String temp2 = decfs.format(anumb);
System.out.println("Decimal format anumb = " +temp2);

Locale Formatting question
In the preceding code the number 50 represent currency.
The output of NumberFormat is 50 with the local symbol
The output of DecimalFormat is 50.00 without the local symbol
The question is how to show 50.00 with the local symbol ???
import java.text.*;
import java.math.BigDecimal;
public class LocalFormating {
public static void main(String[] args) {
NumberFormat nf = NumberFormat.getCurrencyInstance();
DecimalFormat decfs = new DecimalFormat("#,##0.00");
BigDecimal anumb = new BigDecimal(50);
String temp = nf.format(anumb);
System.out.println("local anumb = " +temp);
String temp2 = decfs.format(anumb);
System.out.println("Decimal format anumb = " +temp2);

Similar Messages

  • OIM 11g - get localized challenge questions

    Hi,
    I am trying to retrieve the challenge questions for a given user through the APIs. Right now I am doing what follows:
    challengeQuestions=unAuthSS.getChallengeQuestions(username);
    but this returns the english version of the questions. I would like to get the italian version of those. I know they exists somewhere because it's the localized version that OIM prompts to the user on password recovery.
    How can I accomplish this task?
    Thanks in advance
    Alex

    I guess the localisation is happening via the resource bundles , not that the questions are stored in DB in the localized format .
    Thanks

  • Landscape formatting question

    Can anyone help me with a formatting question? I have a number of PDFs that are landscape format. Every time I open them they default to portrait, even when I change orientation in page set-up and re-save...

    You are only changing the view, not the pdf. Use the Rotate command in the Document menu, not the view menu.

  • Remove Local Formatting AS or JS

    I'm working on a script (AS, but I can link to a JS script from it if necessary) that replaces italic, bold, bold italic, small caps, etc., with character styles. Once that's done, I'd like to go through an entire ID file and remove any other local formatting (kerning, extra space above and below, leading changes, etc.).
    I know how to do this from the Find/Replace dialog (search for TX, replace with TX), but can't quite figure out how to script it and have it do the same for all paragraph styles in a job.
    Thanks in advance, gurus!

    Hi Rick,
    May the below code helpful for you:
    I not able test it here, so please check and get back in case of any issues.
    //First option
    app.activeDocument.stories.everyItem().clearOverrides();    //Clear document including masterpage
    //Second option
    var myStories = app.activeDocument.stories.everyItem().getElements();
    for (i=0; i<myStories.length; i++) {
        if (myStories[i].textContainers[0].parent.parent instanceof MasterSpread || myStories[i].textContainers[0].parent instanceof MasterSpread || myStories[i].textContainers[0].parent.parent.parent instanceof MasterSpread || myStories[i].textContainers[0].parent.parent.parent.parent instanceof MasterSpread) {
             continue;
            myStories[i].texts[0].clearOverrides(OverrideType.paragraphOnly);
             myStories[i].texts[0].clearOverrides(OverrideType.characterOnly);
    Thanks
    Siraj

  • Cascading lookup format questions

    Hi everyone,
       I have a couple of questions regarding formatting the cascading look up fields.  I have a list that filters classes and mnemonics by educator which works fine however on the entry form, when the "Educators" drop down menu is changed,
    a secondary description box appears. The question is, how do I get rid of that secondary description box?
    The second formatting question is that when I have filled out the form, on the edit entry form, there is a hyperlink to the list that the cascading lookup is using as a reference. How do I get rid of that link? See image 002 below

    It's not easy to understand the question, please attach the image here.
    if you mean to achieve a cascade lookup in SharePoint new/edit form, after selecting one column, the cascaded column below will show with filtered value, otherwise, the column is hidden, you may consider to use JavaScript/JQuery to show/hide the second column,
    following is an article about how to use cascaded lookup in SharePoint:
    http://www.sharepointboris.net/js/spcd/
    Qiao Wei <br/> My blog:http://blog.goobol.com

  • Date formatting: how to get specific fields showing in localized format?

    Hi all,
    I would like to take a Date object and format it into the localized format while at the same time specifying which fields should be showing. E.g. ensure that I always have, day of week, day of month, month, year, hours, minutes, seconds and milliseconds regardless of locality.
    Is it possible to do this and if so how?

    For that there is java.util.Locale

  • Show local formatting

    Hello,
    I use a script to detect in InDesign document where there are local formatting styles applied. I found this script under :
    http://www.indiscripts.com/post/2010/05/show-local-formatting-in-indesign-cs4_
    It works well but I am trying to detect also when :
    the style by default is applied [ Paragraphe standard]
    any style is applied  (ex: when text was copy and paste without style applied)
    Do you know if it's possible to declare this thing ? Is there any method ?
    Thanks in advance for your help

    Apologies not necessary. That previewColor property has been a mystery for quite some time, and when I finally found out what it is supposed to do, it seemed to be so bug-ridden that I quickly steered away from it and I gave up attempting to make any sense of it. But your script just avoids those bugs popping up!
    As I said in the IDS post: it's rather sad the Adobe team gave up on further developing this great hidden feature into a full one; and it's downright worrying that they left that legacy code in CS5 and later, so it could get infested with all those nasty little bugs. It leads me to think: how many more 'dead' code is there, in CS5, 5.5 and now in CS6? Could that be the reason later versions are so much slower and more buggy than my trusty CS4?
    (Point in fact.
    In CS4 and earlier on the Mac, all plugin resources are gathered into neat, small packages inside a single large indexed file. That makes sense, because every single plugin resource is just a couple of bytes long -- say, a single icon, or a single string "Menu Item Name". With CS5, the programmers suddenly took a Lazy Turn and wrote out every single resource as a single small file. That means that
    1. (Annoying!) Since hard disk space is allocated by the kilobyte (typically 4Kb chunks), 10 tiny resources totalling 1 Kb now will suddenly occupy 40 Kb of disk space. Sure, hard disk space is cheap. Apparently, it's even cheaper than doing some programming -- or even just using the load code from the last version!
    2. (Frustrating!) Locating, opening, loading, and then closing a single file takes time and resources, but after a file got loaded into memory, you can do with it whatever you want. Locating, opening, loading and then closing each of the dozens of small files per plugin takes lots of time. Is that the reason CS5.5 starts up so incredibly slow? Jongware sez: yeah for sure it won't help.
    /Point in fact).

  • How can I change a local format (bol, italics) to character style

    Hi, I'm new in scripting. I need to change local formats to character styles in some documents, but I can't find the proper ID Object Model to do it in Java. Can somebody help me?

    Thanks for the help! It worked! But I have two problems now:
    1. The documents use Helvetica fonts (light, lightitalic, semibold, etc.) on headings, and the script doesn't recognize nor replace them as character styles. I guess I should replace those fonts with a compatible one (Times New Roman, perhaps). Is there any script that may do that?
    2. Some paragraph styles use bold by default, but the script generates a character style in that cases too. The perfectpreptex you send me attend to fix this problem, but the styles document crashes!!

  • Local radius question?

    Hi,
    I was just taking a look at the local radius functionality on a router. I've found a strange problem which doesn't make sense to me and I was wondering if someone could explain what I'm seeing. As a basic lab to learn the ropes with local radius I created a local radius server on my router and got the local vty lines to use it for authentication.
    This is my config:
    interface Loopback0
      ip address 192.168.0.1 255.255.255.255
    ip radius source-interface Loopback0
    aaa group server radius LOCAL-RADIUS
    server 192.168.0.1 auth-port 1812 acct-port 1813
    aaa authentication login default group LOCAL-RADIUS
    radius-server local
      nas 192.168.0.1 key 0 <removed>
      user mwhittle nthash 0 <removed>
    radius-server attribute 32 include-in-access-req format %h
    radius-server host 192.168.0.1 auth-port 1812 acct-port 1813 key <removed>
    radius-server vsa send accounting
    Now he's the strange thing... If I configure the radius user to "mwhittle" with the password "mwhittle" it works and I get an Access-Accept. If I configure anything another than the username for the password it doesn't work and I get an Access-Reject. I have tried many combinations but as long as the username and password are the same it works and if they aren't it doesn't. This can't be normal behavior unless I'm missing something.
    Any ideas?
    Kind regards,
    Mike

    Hi,
    What kind of RADIUS client application are you using with the IOS local  RADIUS server?  Please note that this server supports *only* wireless  clients,
    and only for the LEAP and EAP-FAST EAP types, and also MAC authentication.  It does not provide support for other kinds of RADIUS clients.
    The fact that username=password happens to seem to work is, I believe, an accidental artifact of the MAC authentication support, where username
    is always equal to password.
    If we are not using the MAC auth, then please feel free to open up a TAC case and we will help you..
    lemme know if this answered your question..
    Regards
    Surendra
    ====
    Please dont forget to rate the posts which answered your question and mark it as answered or was helpfull

  • Adding loops and loops format question

    Hi, i've been facing difficulties adding loops into my GB. My problem is: "Loops do not appear in my loop browser nor the loop list from the silver loop bar above the browser".
    Yes, forgive me for asking this repeated question but after checking the help tutorial, my personal GB guide books, and even HangTime's FAQ, sadly, i still dont find any answers.
    Generally, the procedure is pretty simple from all the sources i've read. Simply drag the folder or loops into the browser and thats DONE right? I did exactly what it said but sigh...maybe there's something wrong with my Macbook?
    For your information, all the loops that i've been adding are loops from CDs coupled with FutureMusic and ComputerMusic magazines, so i believe the sources are pretty reliable i hope.
    As i was struggling to add the loops, this msg popped up for the first time; "Loops that are not in Apple format will not be added into GB"
    So, is the loop format the main cause of my problem?
    if yes, is there any way to convert the format? what is the procedure?
    ps: My current status is, some loops i added are in my browser while some dont although they exist in User/Library/Audio/AppleLoops/UserLoops.
    Thank you in advance.
    Peace

    So, is the loop format the main cause of my problem?
    likely.
    if yes, is there any way to convert the format? what is the procedure?
    apple's loop utility:
    http://www.bulletsandbones.com/GB/GBFAQ.html#looputility
    also note:
    http://www.bulletsandbones.com/GB/GBFAQ.html#missingloops

  • Converting from PDF directly to Java Objects/XML (and PDF format questions)

    Hi,
    I posted this originally in the Acrobat Windows forums but was told I might have more luck here, so here goes:
    I am desperately trying to find a tool (preferably open source but commercial is fine also) that will sit on top of a PDF and allow me to query it's text for content and formatting (I don't care about images). I have found some tools that get me part of the way there, but nothing that seems to provide an end-to-end solution but is quite lightweight. My main question is WHY are there so many tools that go from PDF to RTF, and many tools that go from RTF to XML, but NONE that I can find that go PDF to XML.
    To clarify, by formatting I simply mean whether a line/block of text is bold/italic, and its font size. I am not concerned with exact position on the page. The background is that I will be searching PDFs and assigning importance to whether text is a heading/bodytext etc. We already have a search tool in place so implementing a pure PDF search engine is not an option. I need a lightweight tool that simply allows me to either make calls directly to the PDF OR converts to XML which I can parse.
    Some tools I have tried:
    1) PDFBox (Java Library) - Allows the extraction of text content easily, but doesn't seem to have good support for formatting.
    2) JPedal (Java Library) - Allows extraction of text content easily, and supports formatting IF XML structured data is in the PDF (not the case for my data).
    3)  Nitro PDF (Tool) + RTF to XML (script) - This works quite nicely and shows that PDF to XML is possible, but why do I have to use 2 tools? Also, these are not libraries I can integrate into my app.
    4) iText (Java Library) - Seems great at creating PDFs but poor at extracting content.
    I don't really expect someone to give me a perfect solution (although that would be nice!).
    Instead, what I'd like to know is WHY tools support PDF to RTF/Word/whatever retaining formatting, and other tools support RTF to XML with the formatting information retained. What is it about PDF and RTF/Word that makes it feasible to convert that way, but not to XML. Also, as I found in 3) above, it is perfectly feasible to end up as XML from PDF, so why do no tools support this reliably!
    Many thanks for any advice from PDF gurus.

    XML doesn't mean anything - it's just a generic concept for structuring
    information.  You need a specific GRAMMAR of XML to mean anything.  So what
    grammar would you use?  Something standard?  Make up your own?
    However, there are a number of commercial and open source products that can
    convert PDF to various XML grammars - SVG, ABW, and various custom grammars.
    But the other thing you need to understand is that most PDF files do not
    have any structure associated with them (as you saw when using JPEDAL).  As
    such, any concepts of paragraphs/sections/tables/etc. Are WILD GUESSES by
    the software in question.

  • And a partition in a pear tree...format question

    Well, I've spent almost an hour of my life I won't get back. Trying to archive an iDVD project (33gb) from internal hard drive to new Lacie 160g external. Keep getting "Error in archiving project" message. Even though I was able to copy some large folders onto the drive, with no problem, iDVD doesn't like that the drive is apparently formatted to FAT. I assume. Whatever. Okay, I'll play: I'm ready to reformat the drive. Understand HOW....but that's not the question....
    "You can choose up to eight partitions." Okay, Eight. How about seven? Why not 1,000? How do I, as the APPLE tech support docs says, "choose the number of partitions I want" if I don't have a clue as to why I am choosing them. I figured two would be good enough. So, any help would be appreciated (I've copied the files back over to what's left of the hard drive so I can format now with impunity. I hope this solves the "you can't get there from here after spending more time and money" message. All I want to do is archive the files so I can get 155gb of the 160gb hard drive back. And understand "choose the number of partitions you want" and run the disk utility instruction.

    Hi TuckerdogAVL
    What you need to do is partition the drive in Mac OS extended for it to work with iDVD6.
    Go to applications>Utilities>Apple's DU
    The procedure might look something like this:
    Click Here
    Hope this is Helpful.
    P.S. I like the title to your Post! (Merry X-mas).

  • Photo format question

    Newbie question: when designing an ID document (let's say ID CS4, since that's what I'm using), is there any difference in placing a Photshop image (.ps) versus a .TIF file? I've done both. And is there any harm in using high-res .JPG's? I have a friend who works in Quark and he always changes every photo to .TIF before placing. Thanks.

    Resizing is a different issue altogether from format.
    It's safe to scale the image in ID regardless of the format. If you look in the info panel with the image selected you'll see two resolution numbers listed, actual and effective. Actual is just the resolution at the dimensions the image was saved and is essentially irrelevant. Effective resolution is what you have at the dimensions you are currently using, and that's the number that counts. If that number is in the range that is acceptable for the type of output you are using, there is no need to resize the image in Photoshop at all.
    If you MUST resize the image, then yes, convert to something besides jpeg if that's what it is to start. And keep in mind that up-sampling won't improve image quality in general, and downsampling more than 20% or so can cause you to lose fine details (but so will scaling down).
    Peter

  • Apple mail formatting Question

    I just bought a MBAir and in using Apple mail I cannot seem to format email replies to contain an extra two lines of blank space above the original email.  Is there a way to format email replies to do this automatically?

    Roland,
    What is the question? The reference to the system administrator, is more in reference to how the IMAP server is configured. Does this IMAP work, as expected?
    Ernie

  • Ps3 format question, and more..thanks

    hi guys, i transferred a hd movie from my sony camera to my ps3 it plays great, when i copyed the movie from my ps3 to a external hdd, to edit with imov09, it wont play. the file is there, any ideas>
    also i took a clip of it and converted it to mp4, and another to quick time, they played ok, however when i dragged across to edit in movie 09 ,it wont allow them in to be edited ?
    where am i going wrong? any help would be great.
    thank you.

    Here are ones that appleman posted -- they will work for imovie9 just use export quicktime movie
    I did some experimentation based on a post by Dan Hawkins in the "Pro" forums. I experimented with his settings using the Quicktime Export option in iMovie 08 and they worked. His post is below.
    ============================================================
    from Dan Hawkins:
    I am using a PS3 to preview HD video edited in FCE-3.5.1HD with the following QT-PRO export settings:
    1) export from FCE using Quicktime conversion
    2) select format MPEG-4
    3) select options:
    a) under file format select MP4 (not MP4 ISMA)
    b) under video tab select H.264
    data rate in the range of about 10000 to 18000 kbits/sec depending on what filesize/quality you are shooting for
    image size---select 1280X720HD or 1920X1080HD
    frame rate---select 29.97 or "current" if already on a editing timeline of that type
    key frame---select either automatic or every 24 frames
    video options---select "MAIN" profile and single pass encoding (when I use "MULTI-PASS" encoding I get a "FILE UNREADABLE" error message on my PS3)
    c) under audio tab select default AAC-LC
    d) under streaming tab select default "not enabled"
    I transfer the resulting high definition .MP4 file to the PS3 by one of the following methods:
    ethernet network connection
    iPod/thumb drive
    SD-card
    I have to hit the "alternate menu" under the PS3 video section and select "display all files" to see the video file and then save it to the local PS3 HDD (some dumb programming there!).
    I have heard there might be an upper limit of 4Gb on the file size (if so, another dumb move), but have not come across that limitation yet (I just got the PS3 about a week ago and am working through some of the same issues you seem to be struggling with).
    I think that some of the confusion regarding the PS3 relative to playing back HD from regular DVD-R is that the PS3 will hardware decode a properly encoded .MP4 HD video file from whatever media it is presented on and as such does not require a HD "authoring" container with menus and such. These so called "HD authoring tools" are currently in a pretty confused state at the moment and are the source of much incompatibility with many HD playback devices, but the PS3 bypasses all of that and plays the file directly through hardware decoding.
    ========================================================
    along with this thread
    http://discussions.apple.com/thread.jspa?messageID=7022027&#7022027
    Message was edited by: Sheryl Kingstone

Maybe you are looking for

  • How to find out what process touched a file

    I am currently running Leopard 10.5.7 on a MacBook. Some of my system files' permissions keep getting screwed up. It happens randomly, and when it does I have to repair permission and reboot the computer to fix it. I am trying to isolate the problem.

  • How can I get Firefox to allow ads on websites?

    When I load websites I don't see adds. This is most apparent on these sorts of sites (e.g. http://smashboards.com/ ) where I see a banner saying I have an ad-block enabled instead of seeing an advert. I do not have ad-block extensions. I have tried d

  • SCEP Build and Capture

    Is it a best practice to install SCEP together with its definition updates during build and capture? If yes, will the definition updates get installed during the "Install Software Update" step?

  • HELP: Synchronization between Disc Plus/Viewer/Admin/Client

    Can anyone explain this to me: changes in end user layers in admin edition and reports in desktop edition aren't showing up in disc plus and viewer (using the same schema). I've even deleted business areas that are still showing up in disc plus!!

  • B2B Schema

    IHAC who wants a "high-level database design document for B2B that includes user/schema definitions". Is there an ERD of the B2B metadata repository somewhere that we can share with the client? If not, can you point us to the .sql and .ddl scripts fo