user22062: Thought this would be simple but doesn't seem so.  How can I remove all numbers after the decimal point in an expression, or round down to 0 decimal places (which is the same result)
For instance I have an integer: 2903.99302
I want to remove everything after decimal place, so that it results in 2903
Can't find how to do this.  Some ideas:
num = 2903.99302;
dec = num.search(".");  // OR dec = num.find(".");

result = num.substr(0, dec);

or
num = 2903.99302;
result = num.rounddown(0);

or
num = 2903.99302;
result = num.toFixed(0);

Apparently AE can also use JavaScript in recent versions.  I'm on version 2021 and it's not basic javascript functions aren't recognised so not sure if there's some weird syntax...

user4426: Normally I would use Math.round like this when trying to display text:
slider = (effect("Slider Control")("Slider").value);
tidying = (Math.round(slider * 100))/100;
SourceText = "$" + tidying + "bn" +"\r" +"DEBTS";

the .value is sometimes needed to force AE to look at the slider as a number, not as an object.
tidying is being done to round (up) to 2 decimal places
\r gives a line break
text is appended with +”text”+
If you want to round down, you can use
Math.floor()

instead

22062: <p>Thought this would be simple but doesn't seem so.  How can I remove all numbers after the decimal point in an expression, or round down to 0 decimal places (which is the same result)</p>
<p>For instance I have an integer: <code>2903.99302</code>
I want to remove everything after decimal place, so that it results in <code>2903</code></p>
<p>Can't find how to do this.  Some ideas:</p>
<pre><code>num = 2903.99302;
dec = num.search(&quot;.&quot;);  // OR dec = num.find(&quot;.&quot;);

result = num.substr(0, dec);
</code></pre>
<p>or</p>
<pre><code>num = 2903.99302;
result = num.rounddown(0);
</code></pre>
<p>or</p>
<pre><code>num = 2903.99302;
result = num.toFixed(0);
</code></pre>
<p>Apparently AE can also use JavaScript in recent versions.  I'm on version 2021 and it's not basic javascript functions aren't recognised so not sure if there's some weird syntax...</p>
 4426: <p>Normally I would use Math.round like this when trying to display text:</p>
<pre><code>slider = (effect(&quot;Slider Control&quot;)(&quot;Slider&quot;).value);
tidying = (Math.round(slider * 100))/100;
SourceText = &quot;$&quot; + tidying + &quot;bn&quot; +&quot;\r&quot; +&quot;DEBTS&quot;;
</code></pre>
<p>the .value is sometimes needed to force AE to look at the slider as a number, not as an object.</p>
<p>tidying is being done to round (up) to 2 decimal places
\r gives a line break</p>
<p>text is appended with +”text”+</p>
<p>If you want to round down, you can use</p>
<pre><code>Math.floor()
</code></pre>
<p>instead</p>
