Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pad v:knownfor entries to 2 digits

  • Loading branch information...
commit 15eccd40537210186d3c8503cd690586bd2c1394 1 parent 926302a
@andreyvit andreyvit authored
Showing with 6 additions and 2 deletions.
  1. +4 −1 lib/processing/segmentation.coffee
  2. +2 −1  package.json
View
5 lib/processing/segmentation.coffee
@@ -1,9 +1,12 @@
Hierarchy = require '../hierarchy'
{EventType} = require '../eventtypes'
+pad = require 'pad'
+
+pad2 = (n) -> pad(2, n, '0')
computeSegments = (userData) ->
- segmentNames = ["g:all", "g:status:#{userData.status}", "g:engagement:#{userData.engagement}", "g:knownfor:#{userData.knownfor}"]
+ segmentNames = ["g:all", "g:status:#{userData.status}", "g:engagement:#{userData.engagement}", "g:knownfor:#{pad2 userData.knownfor}"]
segmentNames = segmentNames.concat('g:' + event for event in userData.values)
View
3  package.json
@@ -6,6 +6,7 @@
"dependencies": {
"jade": "~0.27.7",
"sugar": "~1.3.7",
- "dreamopt": "~0.8.0"
+ "dreamopt": "~0.8.0",
+ "pad": "0.0.4"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.