Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hello readers.
I can't seem to find an easy way to round a float to a specified number of decimal places. For example, round(3.14159, 2) returns 3.14. Is there such an expression to do this in a similar manner or do I need to get tricksy? Perhaps regular expressions would do it? (But I don't really know how to use regex).
Help or advice, please?
Develop games in your browser. Powerful, performant & highly capable.
I was pointed to the suggestion:
"Try: round(N * 100) / 100
for 2 decimal places, or 1000 for 3 decimal places, etc... "
I hadn't thought of that. Ahh math. Is there anything you can't do?