-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds pad for adding zero padding to a number. #514
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
string1: '3', | ||
string2: '5', | ||
example: pad('number1','string1'), // 001 | ||
example2: pad(raw(8),'string2') // 00001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be //00008
right?
Same typo exists in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, missed that. Sorry!
Questions:
@kellyselden, your thoughts? |
@mriska Great points, I like those ideas. |
size1: 3, | ||
size2: '5', | ||
example1: pad('number1','size1'), // 001 | ||
example2: pad('number1','size1'), // 001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example1 and example2 are now the same.
Relevant to the discussion: |
Thanks for those links. I think it makes sense to match those apis. Lets call it padLeft, default to space char, and allow your own char. |
Add notEmpty macro
* Add boolean NAND macro * Add boolean NOR macro * Add boolean XOR macro * Add boolean XNOR macro
This reverts commit 3791bb3.
I've been using this a lot lately and figured I'd submit if you are interested in upstreaming.
I can make mods if something looks shady.
Basically it just does zero-padding of numbers.
README exerpt:
pad
adds zero-padding to a number and returns a string, allows composing