variable with two digits after the point

Hi all

How can I specify variable to work with two numbers (one, three) after the point?

e.q.

Set one to 3.14159265358 like (lack of knowledge here)

return a

3.14 returned must

It is a two-step process:

Set A to 3.14159265358

Set A (round (A * 100)) / 100

The 100 can be changed as needed.

(144176)

Tags: Mac OS & System Software

Similar Questions

  • Number shaped with two digits "behind the point" :-)

    Hello

    Please excuse my very bad English because I'm french :-)

    I use the beta JDE v4.7 and the Blackberry Storm Simulator included.

    I would like to know how to format a calculated result as #. # (a floating-point value with two digits "behind the point') to display in a RichTextField instance.

    I tried this:

    """"
    String strSomme;
    String strSommeTTC;
    Double dblSomme;
    Double dblSommeTTC;
                   
    strSomme = saisieField.getText ();
                   
    dblSomme = Double.parseDouble (strSomme);
    dblSommeTTC = dblSomme * 119,6 / 100.0;
     
    Trainer fmt = new Formatter();
     
    strSommeTTC = fmt.formatNumber(dblSommeTTC,2);
     
    RichTextField affichageField = new RichTextField ("sum TTC:" + strSommeTTC, Field.NON_FOCUSABLE);
    Add (affichageField);
    """"
     
    Only the small portion of code compiles fine but I get an exception when you run the program in the Simulator: javax.microedition.global.UnsupportedLocaleException

    I don't know if the Formatter class is the best way to convert a 45.528652541 to 45.53 number for example.

    Thanks for any help.

    Nice day.

    Marc

    I ended up writing a method to do this...

        final static String toString(double sum)
        {
            // Turn random double into a clean currency format (ie 2 decimal places)
            StringBuffer result;
    
            if (Math.abs(sum) < .01)
            {
                result = new StringBuffer("0.00");
            }
            else
            {
                if (sum > 0)
                    sum = sum + 0.005;
                else
                    sum = sum - 0.005;
                result = new StringBuffer(Double.toString(sum));
                final int point = result.toString().indexOf('.');
                if (point > 0)  // If has a decimal point, may need to clip off after 2 decimal places
                {
                    if (point < (result.length()-2))  // eg "3.1415"
                    {
                        result =  new StringBuffer(result.toString().substring(0,point+3));
                    }
                }
            }
            return result.toString();
        }
    

    I would like to know if there is a better way!

  • Out of amount in Excel does not apply 2 digits after the decimal

    Hi all

    Hello.

    I have an RTF template that is used to pull a release of Oracle EBS R12 report in Excel format.

    There are a few fields on the report, which must present the amount in U.S. dollars. If the XML sent out with the decimals for example 123.45 then it is print correctly on the excel column. But if the XML code sends the output 123 then instead of 123.00 on what it is like 123 exit excel.

    In the "Options" text field, Type was 'normal text '. I changed the "Number" Type and number Format #, # 0.00. But still the same thing.

    It seems, when there is no zeros after the decimal point, Excel is these cells of formatting as 'General' instead of 'Number' and drop the zeros.

    Any suggestions on this please?

    Thank you.

    Published by: 985400 on February 21, 2013 10:59

    Hello

    Here is the simple solution to the problem

    Add two spaces after the 'AMOUNT' field by pressing the space bar.

    Kind regards
    Chatresh.

  • You Tube is not playing video on Firefox with Adobe Flash after the last update

    You Tube and other sites do not play video on Firefox with Adobe Flash after the last update for both. Adobe Flash works on other sites but not You tube and sites that can have embedded videos from You Tube, I'm not sure.

    Adobe Flash not crushed and no error message is visible. All that shows is a black screen for Flash video. Make a right click of the screen shows only a non-interactive 'a film has not loaded' and the clickable link to the home page of Adobe.

    I spent an hour trying things as suggested for past problems similar to this, but none helped.

    I sent sad face, letting you know what I think of the last update for this reason which explains pretty much the same thing, as I have said here.

    I have no other info but if I had a form any entry and queries you I might be able to provide more.

        I think the Flash 12.xx is a phantom. I can't find it on my comp. Only 13.xx shows anywhere but on the Pugins page in Firefox.

    Weird. I have no idea why it does that. Your list of details of the system shows that 13.0.r0 Flash.

       About the .Js I cannot find a User.JS in the profile folder but ther is a user.bk and other files that have.json. Should I do anything with these? 

    If you don't, that's okay. Leave all of the files.

    Does disabling HA in Flash and Firefox work better for you now or even not playing it?

    Make sure your firewall is not something Firefox blocks.

    This happens in other browsers as well?

    The site appears your version of Flash player and your operating system?

    Here is what mine looks like

  • You can play with two players on the same conlsoe on modern war

    XXXXXXXXXXXXXX

    Hi Capcurt,

    Welcome to the Microsoft Answers site!

    You try to play the game live with 2 players on the same console?

    Unfortunately, you can not go online with two people on the same console. Modern Warfare 2 allows a user to sign in when you play in multiplayer.

    Modern Warfare 2 is a completely new game mode that supports 2-player cooperative play in single line of the solo campaign in history. To do this, you will need two machines.

    For better support, you can contact Xbox Forums.

    http://www.xbox360forum.com/Forum/

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • HP Pavilion dv6000 (Vista) starts with a blank screen with a cursor after the original hp logo screen.

    HP Pavilion dv6000 (Vista) starts with a blank screen with a cursor after the original hp logo screen.  Cannot get it to boot Windows.  Any thoughts on next steps?

    I remove the hard drive and attach it to your desktop and use the host operating system to run a check disk on your drive.  The laptop goes hard disk looking for instructions to start and he does not see the correct code.  This is probably due to a damaged boot sector.  Another idea is that your bios has changed and you have changed the SATA from AHCI to IDE type somehow or vice versa. You also left a non bootable disk in the DVD/CD drive.  Remove all disks from your DVD.

  • When you add pictures to the Vista image folder it creates a folder HIDDEN of the same name with two copies of the same image inside

    I use Vista 32 bit. I started to see this problem when I recently copy photos from an SD card.

    When you add pictures to the Vista image folder it creates a folder HIDDEN of the same name with two copies of the same image inside

    I saw hidden files enabled in folder options.

    Any help is appreciated.

    Hey guys... I found the answer... Problem is with the software vaio content analyzer that comes with the vaio...

    It just search for Vaio Content Analyzer (parameters) and deselect

    Video analysis
    image analysis
    analysis of the music

    I went looking for this crazy thing... used almost all types of online scan, and finally to find that it is caused by an internal software only...
    anyway thanks to all... Hope it helps someone in the future :)
  • How to restore a shortcut to folder with its contents after the removal of the trash

    How to restore a shortcut to folder with its contents after the deletion of the Recycle Bin in vista

    Hello

    you deleted the shortcut, not the content; haven't you?

    This program recovers deleted data, etc.:

    http://www.Piriform.com/Recuva

    ___________________________________________

    Why not just make a new shortcut?

    http://www.ehow.com/how_5104544_create-desktop-shortcuts-Windows-Vista.html

    How to create Windows Vista desktop shortcuts

  • Can I convert a ppt file to PDF with PDF Pack with two blades to the page?

    I want to convert a ppt file to pdf format with two blades on the page, rather than a slide page. I can do this with a printer. How do I do this with pdf pack?

    Hi sandyd,.

    When you convert PowerPoint to PDF via Adobe PDF Pack, it will convert each slide in the deck to a page in the PDF file. Unfortunately, there is no way to change this.

    Best,

    Sara

  • What is the name of the circular icon with two swings in the content panel?

    Adobe Bridge CS5

    Win 7 Pro 64-bit

    What is the name of the circular icon with two swings in the Panel content above the thumbnail image of a raw file? I can't find documentation about it.

    Thanks in advance.

    Thanks for the keyword "badge".

    With that, I found it's called a

    "Badge of parameters.

    There is also a badge of culture which has an icon of culture.

  • Problems with Vista start after the update of Norton.

    I had problems with start-up since Norton updated and re-printing my subscription a few days ago.  Initially, the splash screen would freeze, I'll try to re-start, only to be refrozen.  After several attempts, with different amounts of time in between, I tried to start a 'normal', but are also intended to "launch fix."  Microsoft solution is to go back to "settings" before the new and improved Norton Security has been installed.  "Norton isn't too happy with this solution, warning: your firewall is disabled, you are vulnerable to all viruses known to humanity" and Norton resets security and the volley continues.  At some point, the screen may freeze, and I have to start all over again.  Had my Vista Home premium SP1 and SP2 installed this past year, patches and I have had no problems since, so far.  If anything is not easy? The pearls of wisdom would be greatly appreciated.  The garbage man comes tomorrow, I'm tempted to put my computer out of the trash.  Help. Please, I beg you.

    Hello, Heather,

    Boot safe mode with networking.  Download the following tool and run a full scan to exclude the malware.  If the system is infected, Norton will be compromised and would not be able to detect malware.

    http://www.Microsoft.com/download/en/details.aspx?displaylang=en&id=16

    Reboot - still problems with startup?  Uninstall Norton - use the uninstaller to remove all traces.  Restart your system and reinstall the software.

    Norton Removal Tool

    https://www-secure.Symantec.com/Norton-support/JSP/help-solutions.jsp?docid=20080710133834EN&LG=English&CT=United+States&product=home&version=1&PVID=f-home&entsrc=redirect_pubweb

    Once you have completed and reinstalled Norton, test - you still having the problem?  Try the link to clean boot troubleshooting below.

    The best advice I can give you is not no use Norton products.  Use Microsoft Security Essentials, which is freeware.

    Perform a clean boot

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

  • Problems with VPN tunnels after the upgrade to PIX 7.0

    It seems that Cisco has revamped the VPN process on the new Version of PIX 7.0.

    After I've upgraded, I noticed that AH (i.e. ah-sha-hmac, ah-md5-hmac) was no longer supported and all my container transformation games OH no were not converted.

    Another question, if you have enabled on Versieon 6.3, names when you upgrade, tunnel groups will be created (formerly "identity isakmp crypto, crypto key isakmp peer ') which will include a hostname (hostname of identity) instead of IP as it was to the point 6.3. Guess what... Nothing works! Having to delete and recreate it using the IP address.

    See an example...

    tunnel-group OTHER_END type ipsec-l2l

    IPSec-attributes tunnel-group OTHER_END

    pre-shared-key *.

    The above does not work... Having to recreate using the IP address mapped to OTHER_END...

    tunnel-group 2.2.2.2 type ipsec-l2l

    2.2.2.2 tunnel-group ipsec-attributes

    pre-shared-key *.

    Furthermore, I have problems with my racoon and freeswan extranet... Did someone recently updated with success and other gateways VPN provider (i.e. checkpoint, Freeswan and Racoon) work?

    We found the solution for this problem. It appeared that the perfect forward secrecy is enabled at the other side. If a 'card crypto outside_map 10 set pfs' is necessary. With the pix 6.3 version that appears not to make the difference, the vpn works even with pfs disabled on the side of pix.

  • Black screen with blinking cursor after the passage in MSC mode

    I followed the recommendation to disable startup secure in the Bios then move the UEFI Bios to the CSM. But when I go to set up what I see is a black screen with a stable cursor in it. And it doesn t go in the Bios.

    The black screen remains.
    I turn off the laptop and once again now, but I still have a black screen with a cursor that is stable and that s it.

    It's like that and it doesn t go to windows even go into the Bios, I can t.
    What should I do?

    Help, please...

    Hello

    After the passage of the CSM and disabling secure boot UEFI mode, you will not be able to boot from the HARD disk as the installation of Windows 8 requires secure boot and the mode of the UEFI.

    Now you can boot from the disc or other media bootable (USB flash key) to install the Windows 7 system.

    I guess you've made these changes installed Windows 7. Right?

    By the way: what model of laptop you have exactly?

  • Problem with URL ReadyCloud after the installation of the FW 6.5 on RN312

    Hello

    After the update to the official FW 6.5, the URL of the ReadyCloud is always on "'https://readycloud-test3.netgear.com/client/en/welcome.html ' not on the production URL"

    What is the correct production URL?

    Thank you

    OK, it's a problem browser temporary files after the update, sorry!

    I have clean the temporary files IE11, now all URLS are corrected with links PROD. I have this url: https://readycloud.netgear.com/client/en/welcome.html

  • problem with magic network after the recent windows and mcafee updates

    There seems to be a conflict with of cicso latest windows and mcafee updates Network Magic platform. Hard to say which is originally the closing down due to the fact they both tend to update together or to the one right after the other. Could someone look into this?

    Hello

    Thanks for posting this question in the Microsoft Community.

    I'll certainly try and help you get the problem solved.

    I suggest you to check that the windows update history to verify that Windows update may cause the problem.

    (a) click on the "Start" button and select "Control Panel" from the menu that appears.

    (b) double click on "Add or Remove Programs".

    (c) click the checkbox next to 'Show the update' at the top of the window.

    (d) locate the "Windows XP - software updates" header. Below, you will find a list of updates all the date where they have been installed and the installation of the window.

    Provide us update KB number that may cause the closing.

    You can also use the shutdown Event Tracker to stop suddenly.

    Hope this helps and let us know if you need more assistance. We will be happy to help you.

Maybe you are looking for