Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Created May 17, 2015 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Samsinite/26f211696fa2efae4968 to your computer and use it in GitHub Desktop.
Save Samsinite/26f211696fa2efae4968 to your computer and use it in GitHub Desktop.
Pad Number Helper
import Ember from 'ember';
export function padNumber(params/*, hash*/) {
var str = params[0] + "";
var size = params[1];
while (str.length < size) {
str = "0" + str;
}
return str;
}
export default Ember.HTMLBars.makeBoundHelper(padNumber);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment