Hi! I’m trying to convert milliseconds into minutes and seconds. The math seems straightforward, but using formatNumber to set the minutes (time_in_ms/1000)/60 as 0 decimal places, rounds the result instead of giving me the integer. In the documentation, there is a function called trunc that “Truncates a number to an integer by removing the fractional part of the number.”
Any idea where/how I would use this function? It’s not in the list of math functions on the math functions tab. Or, is there another function or approach to get the integer portion of a decimal?
Thank you for your guidance!
Welcome to the Make community!
There is no trunc
function, Make removed it but forgot to update the documentation.
You can use the floor
function instead.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!
2 Likes
Hello @here
I just wanted to let you know that the trunc() function is one of the newly released built-in functions.
You can learn more about them here: 🔥 Feature Spotlight: New built-in functions
2 Likes