Check resolution of double

If I have a double value, how can I check that the double meets a specified resolution.
ie. if I have a specified resolution of 0.02, how can I verify that a double value is evenly divisible by that resolution.
I am dealing with a JTextField so I can verify that the text value does not contain more decimal places than would be allowed by the resolution.
Thanks.

I was thinking if the resolution was passed in as a string "0.02" I could determine that the number of allowed decimals is 2. Then if the text field is "12.24" I could do the following.
if ( Math.round(Double.parseDouble (getText()) * Math.pow (10, numDecimals)) % Math.round (resolution * Math.pow (10, numDecimals)) == 0)
    // text is validis there a better way then passing in the resolution as a String? I suppose I could pass in the resolution a a double and pass in an int the represents the number of decimals.
Any thoughts?

Similar Messages

  • Importing illustrator pdfs into photoshop sometimes won't allow me to open and check resolution?

    Here's the scenario:
    Customer sends me an illustrator file with an embedded image. I need to check the resolution of the image to see see if it is high resolution enough for print. I delete all art but the image in illustrator and then save that file as a pdf with the illustrator default.
    I drag that pdf file into photoshop where I get the "Import PDF" dialog box. I know if I select the "Pages" button, then the resolution and color that appears in the dialog box are not the true specifications for the image. I have to select the "Images" button and open the file from there HOWEVER sometimes this option is not available and the "open" button is grayed out. I have yet to figure out why this happens on some of the pdf files I've saved from Illustrator.
    This is the only way I have found to check resolutions on embedded files where I do not have the actual linked graphic. Does anyone have any ideas? Thanks for any help!

    Just check the resolution in Illustrator instead of exporting a PDF to check in Photoshop.
    If the image only is selected then the resolution is displayed in Control bar.
    It may be in a nest of groups so either double-click repeatedly on the image until you've drilled down to it or select it in the Layers panel where the disclosure triangles will give access to it.

  • Check flag for double invoices in AR masterdata

    Hello all,
    Can you please tell me if there is any flag in AR masterdata transaction FD01 similar with the one in AP masterdata transaction FK01 - "check flag for double inv.".?
    Thank you,
    Daniel

    For customer, there is no such mechanism. There is NO TICK in customer for duplicate invoice.
    It is not required because the amount is incoming, where in case of customer the amount will be outgoing.
    Regards,
    Ravi

  • Check Flag for Double Invoices or Credit Memos

    hello
    can i one please explain me the effect of
    "Check Flag for Double Invoices or Credit Memos"
    please explain with explain
    thanks
    vijay

    as terms itself says that u can post the same invoice twice it helps u in posting the same invoice twice
    suppose u have post invoice 1103#
    now by mistake user trys to enter the sam e invoice to release the payment then system dispalys a messge wrning or error
    but to activate it u need to do the settings in spro-mminvoice---incoming invoice
    and mark the check box in vendor master

  • FK02 - Check Flag for Double Invoices or Credit Memos

    Hi,
    What is the transaction in customizing to set the parameters for check flag for double invoices or credit memos ? (ex: date, reference number, etc.) (so that a warning message will pop-up if  user tries to do such a transaction 2 times)
    The check box check double inv. is already cheked in FK02, but I want to set the different parameters.
    Julien

    OMRDC

  • Checking resolution in a PDF image

    This might be more of an Acrobat question, but is there an easy way to check the resolution of an image that was done in Illustrator and is now sent to you as a PDF?
    Thanks.

    Thanks Monika and Jacob.  The issue is that these files are created by outside sources in Illustrator and an image is dropped into the file.  Usually it is embedded.  At times the IL document is then made into a PDF and that is what we get.  On the PDF, is there a good way to check the resolution.  We have CS5, so I'm assuming if Illustrator editing capabilities are checked while making the PDF we can just open it in IL and check the images that way (Document info > Objects (or Embedded image).  But what if the editing capabilities are not activated.  Any way to check it then?
    Thanks.

  • Check resolution and write in CSV

    I need a script which check the resolution of an image and if the resolution is below 300, it needs to create an CSV/Text file into desktop with the string "Resolution is below 300". Is that possible to do it using script? Kindly advise.

    Checking the resolution should not be difficult.
    var theRes = app.activeDocument.resolution;
    if (theRes < 300) {/*insert code here*/};
    This could be used to write a txt file, but there are probably other examples both on this Forum and on http://ps-scripts.com/bb/
    ////// function to write a preference-file storing a text //////
    function writePref (theText, thePath) {
      try {
        var thePrefFile = new File(thePath);
        thePrefFile.open("w");
        for (var m = 0; m < theText.length; m ++) {
          thePrefFile.write(theText[m])
        thePrefFile.close()
      catch (e) {};

  • Check resolution and clarity for sizing?

    Hello - I have an issue where I print an image to a larger size, say 16x24 and the image in grainy.  How do I check in LR3 what the image will look like at the enlarges size?  I know there is a way!

    You can't use your monitor to preview the printed output graininess of a photo because the Points Per Inch of a monitor is much lower then that of a printed output; Instead a bit of math will give you an indication of the graininess of a photo.
    Divide the pixel width and height of the photo by the corresponding width and height of the intended printed output; take the smallest of these results and this will give you the Points Per Inch or PPI of the photo. For example, let's suppose that you have a 3000 pixel x 4000 pixel photo (approximately 12 Mega Pixel) and you want to output at 16 inches x 24 inches, then you would divide 3000/16=187.5 and 4000/24=166.66 so you maximum resolution given these numbers would be 166 PPI.
    Typically good quality is achieved between 240 and 300 PPI but this also depends on the intended viewing distance; the further the viewing distance the lower the tolerance on PPI and the closer the viewing distance the higher the PPI should be; magazines are printed at much more then 300PPI while posters on a building may be printed at less then 100PPI.
    You can tell Lightroom to enlarge a JPG output to a certain size while mainaining a specified PPI at export time or you can specify the PPI of your given print layout in the print module. If this doesn't give you satisfactory results, you may need software such as "Genuine Fractals 6" to enlarge your photo with less graininess.
    Hope this helps.

  • Script to check resolution of the embedded images in illustrator

    Hi All,
    Is there is any script available to check the resolution of the embedded image in the illustrator.
    Regards,
    Vinoth

    Hi Kenny,
    I posted the following file to the NI outgoinng ftp site-- you'll have to grab it in the next few days before it gets automatically wiped off. 
    ftp.ni.com/outgoing/CompanyName.zip
    Look for the "Using ResultsList Menus.doc" file in the main "CompanyName" folder, it will have installation instructions and step by step how-to-use information.  Also feel free to email me with questions at [email protected]
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Get resolution of double?

    When converting a string to double the result prints out as 0.000000. Of course this is because the default resolution is to six digits. Using 10 digits of resolution gives 0.0000000247. What is the function or the best way to detect the length of this double and print it? (I wish the ".10f" could use a variable in place of 10)
    example:
    char data[]={"+2.47600E-08"};
    double result;
    result=atof(data);
    DebugPrintf("%f\n",result);
    DebugPrintf("%.10f\n",result);
    Thanks, and sorry for the newbie question
    Solved!
    Go to Solution.

    As per your question #2, you cannot do this with DebugPrintf, but using Fmt from the Formatting and I/O Library you can have a parametric number of decimal places in the string representation of a number: see Using Asterisks (*) Instead of Constants in Format Specifiers argument in this help topic.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Does anyone know how to check boxes without double tapping

    I am trying to create a touch screen form, which needs to be quick to use. I have designed one on numbers but have to double tap to check the box.

    if its being done in excel it being done through a macro in the background that checks the "SelectionChange" event. It looks at the current selection and if it is 1x1 (single cell) and in the proper column, then it adds the number.
    Sorry to say that *macros are not supported in numbers for ipad* and your current excel file will most likely not work. Although you can open it in numbers and try. I would love to see how it was done if it works.
    Jason

  • Is there a method to check that a double is not null

    Hi all,
    I am trying to verify that a user has entered a double value when my system asks for the price of an item. I have tried doing if (price == null) throw new Exception ().. but that gives me a compiler error saying that null cannot be applied to double.
    Is there an easy way of doing this, or am i missing something obvious ?
    thanks
    dav

    <dekassegui>
    I will say that I assumed an existing screen for non-numerics; if he's not, then I would have to amend my statement to be "numeric, non-zero".
    The question of whether one method is better depends on whether zero is an acceptable price. Without further details, I assumed that it wouldn't be. Your approach allows it.
    Parsing is marginally simpler if the input is treated as a double.

  • Check box showing double when PDF opened in Preview

    I'm setting up a simple check box functionality on a PDF my company sends out. I noticed the check boxes look strange when the PDF is opened up in Preview on Mac. Not sure about PC as we don't have one here. It appears to look fine in Acrobat but I believe a good portion of our clients will use Preview. What you see in the image below is the result when I make a check box and change the color to blue green. The black check mark over it comes out of nowhere. My temporary work-around is to make the check mark art invisible so just that crappy black line shows up instead, although I hate the way it looks.
    Any help is much appreciated, thanks!

    You should always include a link to the FREE Adobe Reader with advice that best results will be seen using it when you distribute a PDF.
    Of course you cannot control what others will use, but if you expect them to use Preview you need to dumb down the design accordingly.

  • How to check resolution of picture

    Hello,
    Sir I am trying to see a way of finding resolution of any picture, in other way, is the picture is 8 bits or 16 bits etc but I am confused how to do it. I tried to used to Ni VIssion Assistan where I created a histogram but then at coding, I am confused how to utilize this histogram. Unable to analyse this histogram and could not draw anything of this histogram. Could you please help to achieve my target. Thanks
    Solved!
    Go to Solution.

    Hello,
    Thanks for guiding me. I have tried to make it in Vision Assistance and the way you showed me as well however could not manage to display the image. Please look at my vis and can find the mistake. One more thing, I am using 2011 version, if you make any amendment could you please upload in 2011 labview. Thanks
    regards,
    Jawad
    Attachments:
    Resolution 1.vi ‏41 KB
    resolution.vi ‏79 KB

  • Upgrade check: command-shift-double-click has no effect

    We're installing Adobe Creative Suite 2 Design Premium. We have what should be a valid serial number for a copy of Adobe Creative Suite 2 Premium. However, the installer terms it invalid.
    Someone else in my company just spend a long time with customer service trying the solution of activating the upgrade code window (where you can bypass the problem by confirming a number given by customer service). The instructions are to command-shift-double click on the Invalid Serial Number window. Well, he's done that clicking combination everywhere on the screen, and it's caused nothing to happen except sometimes selecting the text.
    Is there any other way to bring up that window? Does it require an active connection to customer service to even bring up the window in the first place? Is there any larger workaround we could try?

    Correct Lenoxus it is possible the unlocking function may no longer work under Mac OS 10.9.3.  Thank you for the update that our support team was able to generate a non-upgrade serial number after verifying the validity of your upgrade.
    For future viewers of this discussion you can contact our support team at Contact Customer Care.  I would also recommend reviewing Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html and ensuring your serial number is registered under your account.

Maybe you are looking for

  • BAPI_SALESORDER_CREATEFROMDAT2 and ORDER_CONDITIONS_IN with sapnwrfc (perl)

    Hi, with sapnwrfc packet from Piers Harding (v0.31) I try to create a salesorder within a perl script. Without using table ORDER_CONDITIONS_IN my salesorder is created successfull in SAP. Now I want to commit pricing information. Therefor I used ORDE

  • Update contacts feature in Facebook iOS 6 not working properly

    Hi! I've been using the Update All Contacts feature in syncing my phonebook with Facebook. The feature worked for a time but it stopped and I'm not able to update my facebook friends in my Facebook. I tried manually syncing them by adding their @face

  • Quicktime plays everything but Mathxl videos

    I have installed/reinstalled/changed every setting/worked with Tech support(lol) @ Mathxl and cannot get these videos to play. They are .mov files. I need idiot proof instructions on how to fix...PLEASE help I am doing Horrible in a class because I c

  • Every time i try to update adobe shockwave i get a cannot configure messege

    when i run the add - on manager check to see if your plug-ins are outdated --- it tells me i need to update adobe shockwave--- i go through the steps to download and it gives me an error Host cannot configure--- i have a gateway pc with windows 8 tha

  • N97 Mail for exchange - System Error

    Im setting up my profile on Mail for exchange, entered same deatails that is on my n96, I then start to sync and it reads.., Connecting... Connected. then a nice useful message that says system error. Ive switched phone of, back on still the same iss