Permalink
Browse files

Add Utils.roundWhole

  • Loading branch information...
koenbok committed May 11, 2016
1 parent 9c7c945 commit 0430a7ad29cf901d9e9a1064a43dfe757296a413
Showing with 5 additions and 0 deletions.
  1. +5 −0 framer/Utils.coffee
View
@@ -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)

0 comments on commit 0430a7a

Please sign in to comment.