Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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