Skip to content

Instantly share code, notes, and snippets.

@lefnire
Created April 23, 2013 08:52
Show Gist options
  • Save lefnire/5441907 to your computer and use it in GitHub Desktop.
Save lefnire/5441907 to your computer and use it in GitHub Desktop.
Math.floor the view.fn "gold"
diff --git a/src/app/helpers.coffee b/src/app/helpers.coffee
index e237c67..740261f 100644
--- a/src/app/helpers.coffee
+++ b/src/app/helpers.coffee
@@ -102,15 +102,15 @@ viewHelpers = (view) ->
view.fn "gold", (num) ->
if num
- return (num).toFixed(1).split('.')[0]
+ Math.floor (num).toFixed(1).split('.')[0]
else
- return "0"
+ "0"
view.fn "silver", (num) ->
if num
- (num).toFixed(2).split('.')[1]
+ Math.floor (num).toFixed(2).split('.')[1]
else
- return "00"
+ "00"
###
Tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment