Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add Utils.roundWhole
- Loading branch information
Showing
with
5 additions
and
0 deletions.
-
+5
−0
framer/Utils.coffee
|
@@ -418,6 +418,11 @@ Utils.round = (value, decimals=0, increment=null, min=null, max=null) -> |
|
|
return max if max and value > max |
|
|
return value |
|
|
|
|
|
Utils.roundWhole = (value, decimals=1) -> |
|
|
# Return integer if whole value, else include decimals |
|
|
return parseInt(value) if parseInt(value) is value |
|
|
return Utils.round(value, decimals) |
|
|
|
|
|
Utils.clamp = (value, a, b) -> |
|
|
|
|
|
min = Math.min(a, b) |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.