# Math.trunc() COMMAND

**URL:** <https://forum.code.org/t/math-trunc-command/7463>\
**Category:** Resources, Tools, Differentiation\
**Created:** [June 1, 2017, 5:38pm UTC](https://forum.code.org/t/math-trunc-command/7463 "2017-06-01T17:38:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [June 1, 2017, 5:38pm UTC](https://forum.code.org/t/math-trunc-command/7463/1 "2017-06-01T17:38:52Z")

</div>

Hi

I’m wondering why Math.trunc(x) does not work in AppLab?

For example:  
var x = 2.2;  
//x = Math.round(x);  
x = Math.trunc(x);  
console.log(x);

Math.round works but Math.trunc does not work

Thanks

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [June 1, 2017, 8:39pm UTC](https://forum.code.org/t/math-trunc-command/7463/2 "2017-06-01T20:39:09Z")

</div>

I dont think it is supported on AppLab. I don’t see it in the documentation. [https://docs.code.org/applab/](https://docs.code.org/applab/)

---

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [June 1, 2017, 9:38pm UTC](https://forum.code.org/t/math-trunc-command/7463/3 "2017-06-01T21:38:48Z")

</div>

Where can I request that AppLab add Math.trunc into the pool of commands?

Thoughts?

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [June 1, 2017, 9:48pm UTC](https://forum.code.org/t/math-trunc-command/7463/4 "2017-06-01T21:48:23Z")

</div>

Try [support@code.org](mailto:support@code.org)!

---

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [June 1, 2017, 11:21pm UTC](https://forum.code.org/t/math-trunc-command/7463/5 "2017-06-01T23:21:37Z")

</div>

Thank you so much. Peace

---

<div class="post-metadata">

**Author:** ![fleisch1984](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fleisch1984](https://forum.code.org/u/fleisch1984)\
**Post date:** [June 6, 2017, 3:37am UTC](https://forum.code.org/t/math-trunc-command/7463/6 "2017-06-06T03:37:09Z")

</div>

Math.floor(num) works for me! Not in the docs, but a vanilla javascript function.
