Rounding stroke thickness to nearest decimal?

I have a project where many objects have been scaled up and down during the creation of the artwork. And I'm left with some lines that are .9581 pts and some that are 1.039 pts.
Just because I'm a neat freak, is there a script that would round the stroke thickness to the nearest .1 decimal? Or whole number? Or user selectable amount of decimals?

Navarro Parker,
loop through your path items of selection. This is simple, if only path items in your selection exists:
// StrokeThicknessRoundingNearestDecimal.jsx
// required: one or more selected stroked pathItem(s)
// Rounding stroke thickness to nearest decimal
// https://forums.adobe.com/message/6764907#6764907
// regards pixxxelschubser
var sel = app.activeDocument.selection;
for (i=0; i < sel.length; i++) {
if (sel[i].stroked == true) {
    sel[i].strokeWidth = Math.round(sel[i].strokeWidth*10)/10;
But much more complicated, if there are compound paths or e.g. grouped paths or nested grouped grouped … paths and not possible for strokes which are added in the appearance palette.
Have fun

Similar Messages

  • Rounding up to the nearest 0.05

    Hi guys i am trying to round a value up to the nearest 0.05. e.g. the value 94.63 would be rounded up as 94.65
    I have used big decimal with the round half up and round up modes but it still outputs 94.63
    How can I get arround this ?
    Cheers

          * Returns the value rounded up to the nearest 0.05
          * @param  double  value to be rounded
          * @return double  rounded up value
         private static double roundOff(double value)
              return Math.ceil(value / ROUNDUP_FACTOR) * ROUNDUP_FACTOR;
         }Where ROUNDUP_FACTOR = 0.05
    Edited by: fatjack on Dec 20, 2007 6:05 AM

  • Anchor points move and entire shape gets distorted from changing stroke thickness

    I have a fairly simple drawing that I drew at a larger size so I could be precise with it, and now I want to reduce it down to the finished size, and thicken the stroke, but when I make the stroke thicker, my anchor points move and the entire drawing gets distorted.
    In 24 years of using Adobe Illustrator, I've never seen this happen. When I click on the "up" arrow on the Stroke palette a bunch of times to incrementally increase the stroke thickness, I can watch the anchor points "walk" around as my shape gets distorted.
    If I instead enter a numerical value for the stroke thickness, this doesn't happen.
    However, if I use the Scale tool to shrink the drawing down to 10% or 20% size or whatever, with Scale Strokes and Effects UNCHECKED, again, the anchor points move and the drawing is distorted.
    This is all on a brand new installation of Illustrator CS 6 for Mac (though I've been using CS 6 for about 2 years now, my hardrive crashed this past weekend and I had to reinstall everything).
    Did I miss a little checkbox somewhere that I've never seen before that's making this happen?
    Editing this post to add:
    Also, some of the objects in my drawing will not allow me to change the stroke to less than 1 point thickness. If I choose .5 or .25 pt from the pop-up menu, or even if I enter the numerical value, it jumps back to 1 point. Other objects in the drawing do not.
    These objects in question are "rounded rectangle" shapes that I've used the scissor tool on to cut and then used the "join" command to put them together with parts of other shapes that were "scissored' as well.
    All of the "Ellipse" and "Rounded Rectangle" shapes that I left intact do not exhibit this problem with stroke and distortion.

    You are being bitten by the Align-to-Pixel-Grid. Select everything and go to the Transform panel and turn off Align-to-Pixel-Grid at the bottom of the panel; then go to the panel flyout (small triangle, upper right) and turn off Align Objects to Pixel Grid.

  • Formulae - rounding down to the nearest five

    I am new to JAVA programming and not (yet) a brilliant mathematician. Can anybody tell me an algebra formula for rounding down to the nearest 5 (in 100)? Thanks in advance [email protected]

    Your question is not very clear.
    Still I think this would help
    //begin
    int remainder = number % 5 ;
    //We get the remainder
    number = number - remainder;
    //Trim down to the lower value
    if (remainder >= 3){
    number = number + 5 ;
    //If the remainder is 3 or more we should round to the higher value
    //End of block
    Hope this helps
    Shubhrajit

  • Needed to round a number to nearest thousand

    Hi all,
    Can any one say is there any function to round a number to nearest thousand.
    example == 73882 it must be rounded to 74000.
    Thanks
    Ravi
    use small case when you are posting the questions
    Edited by: Vijay Babu Dudla on Dec 15, 2008 12:09 PM

    Hi
    try this:
    DATA: V_IN TYPE I VALUE 73882,
          V_OUT TYPE I.
    DATA: V_1  TYPE I.
    V_1 = V_IN DIV 1000 + 1.
    V_OUT = V_1 * 1000.
    WRITE V_OUT.
    or
    DATA: V_IN TYPE I VALUE 73882,
          V_OUT TYPE I.
    DATA: V_1  TYPE I,
          V_2  TYPE I.
    DATA: V_DELTA1 TYPE I,
          V_DELTA2 TYPE I.
    V_1 = V_IN DIV 1000.
    V_DELTA1 = ABS( V_1 * 1000 - V_IN ).
    V_2 = V_1 + 1.
    V_DELTA2 = V_2 * 1000 - V_IN.
    IF V_DELTA1 < V_DELTA2.
      V_OUT = V_1 * 1000.
    ELSE.
      V_OUT = V_2 * 1000.
    ENDIF.
    WRITE V_OUT.
    Max

  • Round off quantity variable eliminating decimal places

    Hi,
      I have a variable of quan type with value = 1008.123
      I want to round it off with no decimal to be displayed.
      Please suggest.

    Hi,
      Refer
    https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=4565374
    https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=4721312
    https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=2700419
    Regards
    KIran

  • Round a number to 2 decimal places

    Hi,
    I have a computed value that returns 10 plus digits after the decimal place, exampe: 2.2482352941176.
    What is the easiest way to edit this value in TestStand to return a number that is rounded up to 2 decimal places (2.25)?
    Thanks & Regards,
    Don1.
    Solved!
    Go to Solution.

    One way to do this is to use the TestStand functions Str and Val.  The %.2f rounds the number to 2 decimal places.
    Val(Str(Locals.MyValue, "%.2f"))
    Peter

  • Problems with stroke thickness

    Hi, I'm having a problem with my stroke tool setting in Illustrator CS5.   When I try to use 0.5 for the stroke thickness I get 
    something literally 3 times the size of THIS .    So, I was wondering what I could be doing wrong, because I know that it's not supposed to
    turn out like that.
    Thank You for your help,
    RjoyD

    Thank You
    very much Jacob, for your help. I tried your suggestion and switched my stroke to mm as opposed to inches (I'm still learning ) and it looks like it should appear now. I believe my problem has been resolved.
    I hope you have a good day!

  • Rounding off to nearest decimal point

    i have these values
    35.2
    35.3
    35.4
    35.5
    35.7
    35.8
    35.9
    36.0
    i am looking for indexes closet 35.74 in my array. (which is index 4.)
    i used the "round to nearest" function and it gave me 36.
    which is index 7.
    what other ways to get the right index?
    Solved!
    Go to Solution.

    You will always have some difficulties with rounding to a specific number of digits after the decimal point because of the way numbers are represented in binary. When expressed in binary 0.1 is an infinitely repeating expression. Regardless of the display the internal representation of the number always uses the maximum resolution for the data type (8 bytes for DBL).
    So you need to be very careful to define exactly what you  want. If you have an array of values (regardless of the way they are displayed) Then you can find the closest to a Test Value by subtracting Test Value from the array and finding the minimum of the absolute values of the differences.
    Note that in the image below the same values are in Array and Array 2 with the display on Array 2 set for 20 siginficant digits. 
    Lynn

  • Rounding To Nearest Decimal Place

    Hey Flash Family,
    I am getting the correct output i want but is also giving me
    like 8 numbers after the decimal place...all i want is the numbers
    rounded to the nearest cent meaning only 2 numbers to the right of
    the decimal point....what do i need to add to the current code to
    correct this issue.
    Thanks N Advance

    attach that code to the first frame of your main timeline.
    then anytime you need to change the format of a number like
    _root.how.ROIM.val_tcost use:
    _root.return2DecPlaces(_root.how.ROIM.val_tcost);

  • How to round numbers to the nearest .25

    I would like to enter a number in one field and have it rounded to the nearest .25 in another column - (whether that's rounding up or down)
    Example:
    Actual Size
    Adjusted Size
    7.21435
    7.25
    Any help would be appreciated.
    Thanks!

    Hi c,
    The ROUND function limits the precision choices to powers of 10, so we need to work within that limitation:
    Multiply by four, round to the nearer whole number, divide by four.
    Formula in column B: =ROUND(A*4,0)/4
    All cells in B are formatted as Number, with decimal places set to 2.
    Regards,
    Barry

  • Rounding text size to nearest whole number?

    I've had to rescale some artwork, but now I'm left with type sizes that are 71.68px tall, 34.51px tall, etc.
    Is there a script that'll snap all the text in a document to it's nearest whole number or 0.1 decimal?

    // rounds the size of text in all textFrames in your document
    var aTFrame = app.activeDocument.textFrames;
    for ( i = 0; i < aTFrame.length; i++ )
    var fractionSize = aTFrame[i].textRange.characterAttributes.size;
    var RoundedSize = Math.round(fractionSize);
    aTFrame[i].textRange.characterAttributes.size = RoundedSize;
    redraw();
    This will do all the text frames. Copy the above, paste it into a text editor or the Adobe ESTK (ExtendScript Tool Kit) and save as a plain text file with a .jsx extension. Place it into Applications/Adobe Illustrator CSX/Presets/en_US/Scripts folder and restart AI. Run it by having a document open in AI and call it from File>Scripts>scriptname.

  • BED & AED Round up or down without decimal places

    Dear Gurus,
    My client wants BED & AED Round up to nearest value without Decimal places.
    I am using taxinn procedure and JMOP for BED and JAOP for AED As a condition.
    I tried to tick round up in condition , but it is not workig.
    Please help.

    Hi,
    In TAXINN   T code : OBQ3  against ur condition in alternative calculation type (Calty ) column put 17.
    At the same time OB90 against ur company code put 100.
    Then ur problm will be resolved.
    Biswajit

  • Rounding a number to 2 decimal places

    Is there anyway using the Round function to get it to .2
    decimal places rather than the nearest whole figure...
    I have a table that contains product prices, some of these
    are already in a nice 2 decimal format (such as 7.99 or 12.49) but
    I also have some that are like this-43.990002 and this-8.9899998.
    What is the best way to round these to 2 decimal places?
    thanks

    Do some experimentation. If you are using numberformat you
    might not need to use round.

  • Rounding up to a particular decimal place

    Hi,
    I'm bringing a field into my report that uses up to eight decimal places.  I'm tasked with rounding things up to the fifth decimal.  Rather than rounding when the number is five or higher, it should always round up if it is above one.
    So for example:
    2.03827893 rounds up to 2.03828000
    11.40032180 rounds up to 11.40033000
    Any ideas on the best approach for achieving this within a Crystal formula?
    Any help would be greatly appreciated.
    Thank you.

    Hi Bob,
    Right click on the field and select "Format Field"
    In "Number" tab, select "Custom Style" then click on "Customize"
    In the Roundig box you can select the Rounding type.
    --Praveen G

Maybe you are looking for