Very easy question about variables

Can I convert float-variable to String-variable?

Hi, a very easy way to convert almost anything is
called "typecasting". It might sound difficult, but
it isn't.
You use it like this example
> String outcome;
Double input;
input = 3.54789654587;
Output = ""+input;
That's not casting. It's implicit formatting.
What it does is making an empty string and pasting
your number behind it. VERY easy! You can do this
with allmost every type of variables.What it's doing is creating a StringBuffer, appending an empty string to it, then appending the result of calling toString on the Double, which is itself a String. (Though things change a bit in jdk1.5.) It works because StringBuffer.append has versions for each primitive type, and toString exists for all Objects.
One problem is that it's not efficient -- you're doing a lot of work behind the scenes to do something that can be done much more simply. But the bigger problem is that it's using operators in a roundabout way and with implicit results. So it's sort of a hack. "+" is the append operator for Strings (well it actually comes down to an implicit method call, or several). Putting the double on the right side of that also causes an implicit format. So you're implicitly formatting a value, and then appending it to nothing, to get a result. You're not actually meaning to append, you're meaning to format, but you're using an append operator.
The more straightforward way to do it is simply to explicitly format it, using the methods already shown on this thread, or using java.text.DecimalFormat.

Similar Messages

  • Here's a very basic question about 2 TB external drives and Time Machine.

    Here's a very basic question about 2 TB external drives and Time Machine.
    Ihave a Mac Pro with a .75 TB and 1 TB drive.  It also has a 1 TB 2ndinternal drive.  My current external drive is too small so I'll begetting a 1.5 TB or 2 TB drive.
    Obviouslythe new larger 2 TB drive will backup everything on the Mac Prointernal drive with Time Machine.  But there will be 1 TB of space leftover going to waste.
    ShouldI partition the external drive so that the TM portion will be 1 TB andthe use the remaining extra partition for additional file backups withCarbon Copy?
    Thanks for any insights.
    I tried searching around on the new Apple discussion forum, but I find it much harder to use than the old forum I used to use.

    The problem with terabyte drives is that that a 3 TB is about as big as you can get without going into RAID territory. Ideally, a Time Machine drive should be 3 times as large as all the drives you are backing up. So, if you have 2.75 TB of internal storage, you should have 8 TB of Time Machine space.
    Of course, that is "should". If your TB drives are mostly empty, then you can get away with something 3 times the size of your used disk space. Just remember that you are pushing it. Linc is right about Time Machine needing space to work.
    It is unlikely that you have regular churn on 2.75 TB of disk. I suggest identifying which drives and folders have the most activity and excluding those drives and directories that don't change much. It would be better to archive the data that doesn't change often and keep it out of Time Machine. Then you may be able to get away with a 2 TB Time Machine drive.

  • One very basic question about inheritance

    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????

    SumitThokal wrote:
    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????What did you find out when you looked on Google?
    One example of inheritance comes in the form of a vehicle. Each vehicle has similarities however they differ in their own retrospect. A car is not a bus, a bus is not a truck, and a truck is not a motorbike. If you can define the similarities between these vehicles then you have a class in which you can extend into either of the previous mentioned vehicles. Resulting in a reusable class, dramatically reduces the size of code, creates a single point of definition, increases maintainability, you name it.
    In short there are thousands of benefits from using inheritance, listing the benefits could take a while. A quick Google search should give you a few hundred k if not million links to read.
    Mel

  • Easy Question about resizing video

    I searched 'Resizing Video' and there was too many unrelated results to a really simple question.
    In my old program "Premiere', to resize and move a video around was very easy. You could adjust the scale and X-Y values numerically, or you could use a Free Transform like in Photoshop. Simply dragging bounding boxes for size and aspect and also dragging the clip to decide it's location.
    The only way I know how to do this in FCP is I double click a clip in the sequence, it loads into the viewer, I go to the Motion Tab and then I can adjust the Scale, which is cool. But then I'm left with the Distort section to adjust position (and aspect if need be). In the Distort section there are 8 numeric fields of info to figure out and fill out just to get one clip in a different position correctly.
    I'm thinking there must be another way to adjust the location (or aspect) of a video clip without spending a bit of time on exact coordinates, I want to eye-ball where I want the clip to go and simply move it there. Is the Distort feature the only way to do this? If not, which is the fastest way to move and change the dimension of a clip.
    Thanks for reading, I hope there is another way, I'm not use to these calculations and they're slowing me down.
    Monty

    I searched 'Resizing Video' and there was too many unrelated results to a really simple question.
    That's because it's not a simple question at all and yet every one of those threads was related to the OP's question. As you discovered, there are lots of ways to interpret "resize," during capture, editing, effects, output, viewing, encoding, printing. But the solution was even simpler than you thought. All you had to do was open the manual or the online help system. Start taking the manuals to the gym with you. FCP is not Premiere. You're going to hate FCP, you're going to love FCP but it will never behave like Premiere beyond the elements of the functional paradigm. Forget Premiere.
    bogiesan

  • Easy question about Reformatting

    Hello all,
    I am trying to reformat my HD after I have deleted Windows XP off of a partition. The reason for this is an upgrade to Vista and a larger allotment of HD space. My question is:
    I am using Backup v3.1.1. (v369) and I have FULL backup files of my Home folder, and my Music folder (as backup for my backup) for all my iTunes libraries. These are located on a portable HD. Are these the correct files to have backed up in order to have my MAC the way it was before I started the process? If so, then once the reformatting is complete, how do I get it all back onto my MAC permanently? Will all my apps and tweaks work as before?
    I am sure this is a simple question, however, I have never had to do this with a MAC, and I want to make sure I have all bases covered before I begin this. Any other comments or advice would be greatly appreciated.
    Thanks All!

    You call this an easy question ???
    Just messin with ya
    Your home folder is the most important folder containing your music, documents, preferences etc. but a lot is also stored in the system folder and library folder outside your home folder, if you want to be ensured of an exact copy of your current system the best way to go at this is to clone your system partition.
    The app i use for this is carbonCopyCloner
    http://www.bombich.com/software/ccc.html
    To add to this.. i've heard there is software for the mac that allows you to make adjustments to the size of your partitions without having to format the drive, i don't know the names of these products but i do know that it's very risky to use them, if you decide to use an app like that make sure you have proper backups of everything just in case it goes wrong.
    Message was edited by: Pr0digy V.

  • Combobox --- very easy question

    How can I set numbers in a Combobox and assign them
    to a variable ?

    Very easy answer: RTFT
    http://web2.java.sun.com/docs/books/tutorial/

  • A very simple question about WF

    hi experts
    I would like to ask a question about workflow
    as u may know there is 'Loop' step in workflow, but I am confused when should I use Loop?
    Is this step used for processing internal table?  if yes, why shouldn't I create a custom BOR method and pass the entire internal table to the method?
    many thanks

    hi
    loop step for not process the internal table,
    this is used to process the some steps repetely until condition True or False.
    we have two loop steps is there
    WHILE AND UNTIL.
    Thanks
    sitaram

  • Very specific question about iOS 7 and podcasts

    I have a very specific question regarding the playback of podasts under iOS 7.
    Right now, I've still got iOS 5.1.1 (iPhone 4S).
    What I would like to have is a way to play an episode from a podcast that I have not yet finished, and when I double-click the ear-bud's middle button, then I would like to jump (skip) to the episode in the list, even if that episode is from a different podcast.
    Right now, under iOS 5.1.1, I achieved that by creating a smart playlist in iTunes that collects all the episodes from all podcasts with a play count == 0.
    This smart playlist is mirrored to the iPhone.
    It works very well.
    It seems to me that something like that is not possible under iOS 6, so I skipped that.
    My question now is whether I can acheive this under iOS 7.
    I would be most grateful if some kind soul could shed some light on that for me.
    Best,
    Gabriel.

    Hi Larry,
    Thanks very much for posting a reply.
    I do absolutely intend to print a test copy first - but thanks to your advice at least know the spine is going to be ok!
    I didn't realize that method would give me a nice landscape image of the unbound cover - I'd mistakenly remembered that it gave only one page at a time for front and back.
    Thanks for helping out.
    Best,
    Marco

  • Very easy question - loading member list

    Very simple question.
    Do I have to make everyone log off of HFM before I load a member list?
    I had a typo in the member list that I didn't see until I want to do the yearly tax extract, now that I corrected it I want to load the member list, but I don't want to kick everyone off. Just curious to see if it is necessary or not.

    Good morning,
    When I make some changes in the objects (metadata, list, rules, etc.), usually the users, while refreshing, are notified that the application has changed and that it's necessary to log in again. So since it only takes 5 minutes to update the list, I would recommend doing it the first thing in the morning or after the workday.
    Cheers,
    Lu

  • Very simple question about declaring variables

    if a create a new ' int ' as in the code below :
    static int counter;
    does the value of counter automatically default to ' 0 ' ?
    Does this also apply if i declare the var to be public, protected etc ( but not final )
    thanks

    Most languages will initialise an int to 0 if no value is specified but it is dangerous to rely on this as it is not always the case. It is therefore recommended as good practice that you always initialise your own variables to ensure they start with the value you wish and not something unexpected.
    Mark.

  • Very Nube Question About Creating a Very Basic Application Bundle / Package

    I don't know anything about XCode or AppleScript, other than that they exist, so I'm coming at this with only conceptual knowledge of how applications on OS-X work. Nonetheless, I have a goal that I feel should be really easy to accomplish, I just don't know where to begin.
    What I have is an html file with an embedded flash project that also references some outside files, such as pdfs for printing. This was designed to live on the web, but in reality it will be shipped out on a CD. Right now, if you insert the cd, you see the file contents (the above mentioned HTML file, as well as two folders containing the flash files and the pdfs that are embedded in or linked out from the html file).
    This isn't very elegant, and doesn't accomplish the "app" feel I'm shooting for. What I'm wondering is: is there a way to create an application package that has the html file and content folders tucked inside of it, so that when a user clicks on the application package, the html file is automatically launched? What resources might you point me to in order to learn how to do this in a relatively short amount of time? (I'm not even positive if I'm using the correct terminology to search for solutions... is it an application package or an application bundle?)
    Now for the limitations:
    These files were generated on a Windows machine by an eLearning tool ("Articulate Presenter") and therefore really can't be fiddled with much. I can't open any of the flash files and change the directory paths for the resource files the main presentation needs. I'm fairly confident the presentation just refers to the folder the html file is in as its root, so if the file structure could stay relatively intact once all the files move inside this "bundle," I think everything will still work.
    The Articulate Presenter folks aren't particularly helpful in solving Mac compatibility issues, so I thought I'd pose my question here. If I'm not being clear, I am happy to add additional details. Thanks very much for your patience with, and willingness to offer advice to, a complete newbie.
    Cheers!

    It's even easier than you think.
    Open AppleScript Editor.
    Type in the following code:
    set htmlFile to (POSIX path of (path to me)) & "Contents/Resources/index.html"
    set openCommand to "open " & quoted form of htmlFile
    do shell script openCommand
    Then do File > Save, and use 'Application' as the file format.
    Then the "Bundle Contents" button on the toolbar will be enabled. Click it to open up the drawer.
    Drag your HTML content and resources into the drawer.
    Do File > Save again. Ta-da, you have your web-content packaged as an application.
    This assumes that the top-level has a file named index.html. If not, modify to suit.

  • Very basic questions about a db in windows

    I have a db (9.2.0) in a W-XP machine and I have started it up via windows services. (The db was created when installing the software).
    My questions are:
    1. When I connect to the db with the system user it connects to the only db that is created in my PC, but not having the ORACLE_SID variable defined, how would the sqlplus command know which db I want to connect in case I had several?
    F:\oracle\ora92\bin>echo %ORACLE_SID%
    %ORACLE_SID%
    F:\oracle\ora92\bin>sqlplus system
    SQL*Plus: Release 9.2.0.1.0 - Production on Dom Dic 17 19:16:27 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Introduzca la contrase±a:
    Conectado a:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    SQL>
    2. Why can't I connect as sysdba with a windows console? (I suppose there must be some problem with my os user).
    F:\oracle\ora92\bin>sqlplus "/ as sysdba"
    SQL*Plus: Release 9.2.0.1.0 - Production on Dom Dic 17 19:06:19 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    ERROR:
    ORA-01031: insufficient privileges
    Introduzca el nombre de usuario:
    3. How can I write dos commands in sqlplus whitout exiting (in sqlplus for unix I know it is with the ! mark)?

    - I have no idea what the sqlnet.ora files does when
    I connect to my local database by a sqlplus in the
    command window (I thought it played no role as the
    listener does not play any either).http://download-east.oracle.com/docs/cd/B10501_01/network.920/a96581/sqlnet.htm
    - I am very ignorant at windows and do not know where
    to see the user groups, my system only has 1 user
    (there is no oracle user and the oracle installation
    was made with this only user). For me it has no sense
    that there exists an ORA-DBA group because there is
    no oracle user, but I repeat, I do not know how
    windows manages users and groups.If you only have one user on your system and the install was done with that user, then chances are good the user is in the ORA_DBA group. You can find User and Group settings by right clicking My Computer and selecting Manage. You will find the users and groups under Local Users and Groups.

  • VERY Basic Questions about Oracle eBusiness - what "languages" are used?

    Please forgive the very basic nature of this post- (I have been in systems (IT) for over 20 years, so I do have lots of systems experience, but no exposure to this particular software.)
    So here are the basic questions - I assume that much of the data base logic is written in PL/SQL, but what other tools / languages are the applications written in?
    (Oracle Forms, Oracle Reports, Java, C, something else?)
    With over 20 years and experience with a number of other packages, I can learn a great deal about an application by 1. Looking at the DB structures (charts), 2. looking into DB code (Packages, triggers, procedure, functions) and 3. Seeing the screen shots.
    None of my customers have had Oracle eBusiness - that have had home grown applications or other COTS/packages.
    can anyone suggest a place where an independent person can inexpensively get some exposure?
    My sincere thanks for any answers/suggestions. 

    Hi,
    Please refer to the following links for details about the different database releases and Oracle tools.
    Oracle Timeline
    http://www.oracle.com/timeline/index.html
    http://www.oracle.com/oramag/profit/07-may/p27anniv_timeline.pdf
    Oracle Corporation - Oracle FAQ
    http://www.orafaq.com/wiki/Oracle_Corporation
    Oracle E-Business Suite consists of Application/Database/Client tiers, you can find more details in [Oracle Applications Concepts|http://www.oracle.com/technology/documentation/applications.html] manual.
    Oracle Forms
    http://en.wikipedia.org/wiki/Oracle_Forms
    Regards,
    Hussein

  • A very stupid question about MDic application[SOLVED]

    I have tried StarDict in Arch which I think that is the best known dictionary application in Linux world. Since I had to use mouse to access StarDict, I decided to try MDic instead. My problems is that I do not know the default location of MDic dictionary files. After search topics for about two hours, I gave up.
    There must be a directory where MDic searches for dictionary files. Where is it? or What MDic configuration file has the information? So, I can install dictionary files int to the directory. I looked for this information in http://mdic.gnufolks.org/ and google.com. I believe this kind of very fundamental information should be in the wiki fo MDic. But I couldn't find one. Maybe, it is because I am so idiot. Would somebody help me how to install MDic dictionary in a appropriate location or the default location? Thank you so much for your helps.
    Last edited by since1992 (2010-11-06 11:28:30)

    Yes, it was a stupid question. I found that I can configure the location of the dictionary file. I also installed PyGlossary to convert dictionaries for MDic. Everything works fine now. Thank you.

  • Question about variable names

    k, so I have a for() loop that I want to take the value of String fs1 through String fs21 and add them in that order to a String fs. So, my question is, can you do this in a loop? you can do it in PHP, and that's what I'm accustom to.
    this is kinda what I want to make
    String fs = "";
    String fs1 = "foo";
    String fs21 = "bar";
    for(int i = 0; i<22;i++)
         fs+= (the variable "fs" plus the number of "i", so like fs1, fs2, fs3. . . fs21);
    System.out.println(fs);

    I think you want to use and array and be careful about using += that way.
    StringBuffer buffer = new StringBuffer();
    String[] fs = new String[2];
    String fs[0] = "foo";
    String fs[1] = "bar";
    for(int i = 0; i<22;i++)
         buffer.append(fs);
    return buffer.toString();

Maybe you are looking for

  • Warranty Void MSI GE60 2PE APACHE PRO

    Hello guys.I have a question about warranty.I just bought a notebook MSI GE60 2PE APACHE PRO and i figure this notebook HDD is so slow just 5200 rpm.I want to ask if i can install 1-2 SSD without to void thw warranty because the warranty sticker is o

  • The patch directory area must be a number. - 10.1.3 R12

    Hi, I am running an R12 vision instance. I need to apply a patch but whenever I try I get the error "The patch directory area must be a number.". VIS121 r121@ebs121-vm /tmp/stage/15929270 $ pwd /tmp/stage/15929270 VIS121 r121@ebs121-vm /tmp/stage/159

  • How do I get my email on my iPad to open in adobe reader?

    How do I get my email on my iPad to open in adobe reader?

  • Visual basic 2013 and sql server 2014

    now a days I am using visual basic 2013 front end and sql sever back end I want that when I enter custID on vb form in a textbox and press enter all the relevant record of the entered cutID get display on the respective textbox. Please do help me sen

  • How to build and deploy ejb in j2ee!!

    HI there!! Newbie Question. I know this is very rude to ask a question "How to build and deploy ejb in j2ee server??", but please help me. I just learned some servlets worked with tomcat. Now I want to learn more about ejb, could anyone suggest me an