By adding a '%' to the numbers from a string

I have an expression that works in the animation of a percentage based on a slider control.

n = thisComp.Layer ("null 1"). Effect ("the 2 pie slice") ("Slider")

nRound = Math.round (n * 10) / 10;

check = 1% nRound

If (check == 0) {}

"" + nRound + ".." 0"+ « % »

} else {}

nRound

}

What I can't understand, why is the '%' appears only when the number is full and not there permanently? After reading Dan Ebbert page, it shows that you can add in fact (which I thought I did it correctly) but only on integers. When he drives through the 'tenth' the % does not appear.

I'm sure it's something simple, but I can't understand it.

Thanks for your help.

In your if/else statement you only add the % in cases where it is an integer. You will need to change to:

If (check == 0) {}

"" + nRound + ".." 0"+ « % » ;

} else {}

"' + nRound + '% ';

}

Also, here is another way to write the expression:

n = thisComp.Layer ("null 1"). Effect ("the 2 pie slice") ("Slider");

n.value.toFixed (1) + '% ';

Tags: After Effects

Similar Questions

  • regular expression - get the numbers from a string

    Hello world

    I'm trying to use regular expressions to get all the numbers in a string. The only problem is that the chain can vary.

    For example:

    It's my rope 3 and 8 I want 2 get out of those 7 numbers
    Random text 9 with 5 for everyone weekend 8

    How can I do?

    Thanks in advance :)

    Quote:
    Posted by: Scott Stroz

    #numbersOny #.

    Who will be only to crush all the numbers in a large number.

    The attached code will return a nice list of numbers.
    Though the numbers may contain commas or decimal points, the code can easily be adjusted

  • How to get the numbers from a string?

    Hi all

    I have a string Let's say
    '0a1b2c3d4e5f '.

    I want to retrieve all the numbers out of it.

    012345

    Please Guide Me.

    Thank you

    Try

    SELECT REGEXP_REPLACE ('0a1b2c3d4e5f','(*[^[:digit:]]) ', ") double;

  • Extract numbers from a string

    Hello
    i'numbers in the neck of string arrecnote

    Please help me in this...

    Published by: smile on October 7, 2010 05:33

    Published by: smile on October 7, 2010 06:14

    Try this to extract the numbers from a string:

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'hello-cycle monthly settlement;  865.15 SDR
      2  
    multilat net 218.15 (USD) USAWW-USACC-2007/10' col1 from dual) 3 SELECT * FROM 4 (SELECT REGEXP_SUBSTR(col1,'[0-9]+.[0-9]+',1,lvl) col1 FROM 5 (select col1,level lvl 6 from t 7 connect by level <= LENGTH(col1) - LENGTH(REPLACE(col1,' ')) + 1)) 8* WHERE col1 IS NOT NULL SQL> / COL1 -------------------------------------------------------------------------------- 865.15 218.15 2007/10 SQL> -- or if you just want the numbers with its decimal SQL> ed Wrote file afiedt.buf 1 with t as (select 'hello-cycle monthly settlement; 865.15 SDR 2
    multilat net 218.15 124 (USD) USAWW-USACC-2007/10' col1 from dual) 3 SELECT * FROM 4 (SELECT REGEXP_SUBSTR(col1,'[0-9]+[.][0-9]+',1,lvl) col1 FROM 5 (select col1,level lvl 6 from t 7 connect by level <= LENGTH(col1) - LENGTH(REPLACE(col1,' ')) + 1)) 8* WHERE col1 IS NOT NULL SQL> / COL1 -------------------------------------------------------------------------------- 865.15 218.15 SQL>

    Published by: AP on October 7, 2010 05:43

  • selection of numbers from a string

    Hello
    I have a table with address information, and some records in my street_num area contains letters, e.g. (EN), (TO). Some of the records look like this...

    1___ (TO) 3874
    2___ (EN) 83
    3___3908 (TO)
    4___21 (EN)

    Is there a statement which will select only the numerical values so that I can fill out a new field with just the numbers?

    Thank you!

    Hello

    In Oracle 10 (and more), you can use regular expressions

    REGEXP_SUBSTR ( street_num
                  , '[0-9]+'
                  )
    

    Returns the first substring 1 or more digits of street_num.

  • Remove the HTML from a string

    I have some data which are recorded by a rich text editor, but I need to display it in a datagrid without HTML tags.

    Someone at - it a regular expression for the elimination of all of the HTML in a string?

    Y at - it another way to do this in flex.

    Thank you

    Nevermind I found it. In case anyone is interested.

    [var myPattern: RegExp = /<[^>] * > / g
    txt = txt.replace(myPattern,"")

  • IllegalStateException when adding label to the screen from timertask

    Hello

    I have a thread that gets the text for a labelfield. I just want to add the labelfield on-screen when the thread is finished.

    I have a timertask that checks when the thread is finished and when the thread is finished, he tries to add the label to the form.

    This is the code, but when I try to add the label I get illegalstateexception-

    GTC GetContent = new GetContent();
    t = new Thread (gtc);
    t.Start ();
                
    Timer = new Timer();
    timer.scheduleAtFixedRate (new TimerTask() {}
    public void run() {}
    {if (! t.IsAlive ())}
    Timer.Cancel ();
    Test string = t.getTextLabel ();
    addLabel (new LabelField (test));
    }
    }
    Invalidate();
    }
    (}, 1000, 1000);

    }
            
    Private Sub addLabel (LabelField l) {}
    Add (l);
    }

    If she runs in an external thread to wrap it in an invokelater (or the synchronization on the eventlock).

    You can check the exceptions by surrounding the code with a try/catch.

  • SQL query to get the numbers from 0 to 99

    How can we write a sql query to get values from 0 to 99... This should not come from any table
    SELECT LEVEL - 1
      FROM  DUAL
      CONNECT BY LEVEL <= 100
    /
    

    SY.

  • How to separate the numbers in a string?

    I had a string that contains a lot of numbers, how can I separate them?

    I tried to use unbundle, but it does not work

    Whatever your question has to do with the acquisition of data?

    You don't have a channel there at all. It looks like an array of clusters. Before the unbundle, did you use the Index Array?

    Not to recognize the types of data indicates that you are at the beginning of LabVIEW. At least, you should take one of the free tutorials on the l line.

  • Extraction of the data from a string

    Hi all

    I'm using Oracle 11.2.0.1.0

    CREATE TABLE BENEFIT(
      BENVAL       VARCHAR2(255 BYTE))
    

      insert into BENEFIT values ('Included - 365 days/50%/50%   ');
        insert into BENEFIT values ('Included - 120 days/50%/50%   ');
            insert into BENEFIT values ('Included - 365 days/75%/50%  ');
    

    I would like the following output.

    BENVAL Days FIRSTPER SECONDPER
    Included - 365 days/50%/50%3655050
    Included - 120 days/50%/50%1205050
    Included - 365 days/75%/50%3657550

    The days column must be set in the chain before days, the firstper column must be set between Prime ' / ' and the second ' / ', the secondper must be set after the last ' / '.

    Currently, I created a table to store the distinct values in a table and by referencing tables in my select query. Instead, I wanted to know if I can create a SQL statement.

    Thanks in advance.

    Hello

    Perhaps the easiest way is:

    SELECT benval

    , REGEXP_SUBSTR (benval, '\d+', 1, 1) AS days - or TO_NUMBER (REGEXP_SUBSTR...

    , REGEXP_SUBSTR (benval, '\d+', 1, 2) AS firstper - or TO_NUMBER (REGEXP_SUBSTR...

    , REGEXP_SUBSTR (benval, '\d+', 1, 3) AS secondper - or TO_NUMBER (REGEXP_SUBSTR...

    BENEFITS

    ;

    Guess what

    1. all 3 numbers are present,
    2. the days always appear first (as they do in the sample data),
    3. If there are other numbers in the chain, these additional staff come after percentages, and
    4. 3 numbers you want are unsigned integers.

    If any of these assumptions are false, then you can always use REGEXP_REPLACE, but things get a little more complicated.

    REGEXP_SUBSTR returns a VARCHAR2.  If you want a NUMBER, call the string passed by REGEXP_SUBSTR TO_NUMBER.

  • Remove the schema from a string

    Hello

    I was wondering if there is any better way to do something like that?
    SELECT 
        REPLACE( 
          REPLACE( 
            REPLACE(
              'SOMETHING .A .B .C Something else !', '.A',''),
            '.B', '' ),
          '.C', ''
        )
    FROM DUAL;
    This is just one example. My real case is a little more complex. So I would remove the. A. B. C. now I use REPLACE followed by the template should be deleted and I put an empty string as a replacement string. And it does the job properly. But I was wondering if there is another way that can avoid me using 3 Replace.

    Thanks for your help,

    user13117585 wrote:
    Me being stupid again...

    Sorry for this stupid question.

    SELECT
    TRANSLATE('SOMETHING .A .B .C Something else !', ' .A.B.C',' ')
    FROM DUAL;
    

    Not a stupid question at all. Assuming that you want only to remove the actual strings. A. B and. C, so it is actually more difficult than it sounds. Consdier:

    SQL> SELECT TRANSLATE(x, ' .A.B.C',' ') xlate,
      2         REGEXP_REPLACE(x, '(\.A)|(\.B)|(\.C)') rexp
      3  FROM (SELECT 'SOMETHING .A .B .C Something else !' x
      4        FROM DUAL
      5        UNION ALL
      6        SELECT 'SAMETHING .A .B .C Another Bit !'
      7        FROM DUAL);
    
    XLATE                               REXP
    ----------------------------------- -----------------------------------
    SOMETHING    Something else !       SOMETHING    Something else !
    SMETHING    nother it !             SAMETHING    Another Bit !
    

    John

    Published by: John Spencer, March 8, 2011 09:10
    ADED the SQL instead of just the results

  • I want to analyze the values from a string

    Hello.. I want to analyze certain values in a string... it's values in my channel...

    anyType{NewDataSet=anyType{Table=anyType
    {SINo=5; ProductId=33;productname=aaa;
    price=543;};Table=anyType{SINo=1;
    ProductId=111;productname=bbb;price=543;};};}
    

    I need to display my SINo, ProductId, productname and price... everything separately... is it possible? or is it possible to convert this string to an xml and then parse the values?

    You can write a function to split this string with respect to the level of a delimiter, in this case '=' can be used, like the Split function available in the string for the Desktop Java class.

    This function returns an array of strings in which the split string values is stored.

  • Display of the numbers 1 to 9 as 01-09?

    I am looking for a formatting script that shows the numbers from 1 to 9, according to 01 / 09, so if the user would be at the '3' entrance, for example, he if he would display as "03." I thought it would be easy, but keep coming up short. Can someone please?

    You can use this code as the Custom Format script:

    If (event.value) event.value = util.printf ("% 2d", event.value);

  • How to make a book to skip sections when the numbering

    Hello

    I have a file of book into several files. I would add in the pages of circuit breaker which are ignored by the auto-numbering. Here is an example

    Section1 1-10

    Breaker1 i - ii

    Section 2-20 2

    Breaker2 i - ii

    I know I can do this manually but if the number of pages in sections changes everything, once it is thrown.

    Thank you.

    As much as I know there is no automatic way to break the numbering sequence. If you have several files in a section, you can set everything but the first to continue the numbering from the previous document, but no matter what file it takes retstart numbering after a jump must have its start manually page assigned.

    Section 2 really restarts on page 2, and you repeat the lowercase Roman numerals? These aren't good ideas, ID who likes pages to have identifiable unique numbers, either for readers who expect the same.

  • Erase the numbers using GREP?

    Hi guys,.

    Could someone help me please? I only find GREP in inDesign if Im not that clued up on it. I searched the web, but can't seem to find a way to remove the numbers from sequntial a document - is it possible?

    I essentially several documents containing some old page numbers in parentheses - is possible to use GREP to search and delete, including the media? That is to say, [1], [2], [3], etc.

    Thank you!

    Hello

    [Of course, try this: \[\d+\]

    This will find any number of numbers in brackets, including the media.

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

Maybe you are looking for