Skip to content

Commit ab3a273

Browse files
committed
add comment about using toFixed
1 parent e6f020e commit ab3a273

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.ls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ round = (n, d = 5) ->
44
p = Math.pow(10, d)
55
ret = "#{Math.round(n * p ) / p}".split(".")
66
+(ret.0 + (if ret.1 => "." + ret.1.substring(0,d) else ""))
7+
# or use this: +(n).toFixed(d)
78

89
sample-func = (t) ->
910
Math.abs(Math.sin(Math.pow(3 * t + 1.77, 2)) / ( Math.pow(3 * t + 2, 5 * t) + 1))

0 commit comments

Comments
 (0)