Replies: 1 comment 2 replies
-
That's available in the default math library (built into Carpet), you can import it placing import('math', '_round'); at the top of your script and then call it using |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A scarpet implementation would be something like
round(num) -> round(num, 0);
round(num, places) -> (offset = 10^places; round(num*offset)/offset);
I'm finding myself needing this function more often than I expected and so I wrote
roundp(num, places)
to accomplish this.Beta Was this translation helpful? Give feedback.
All reactions