diff options
author | fhats <fhats@yelp.com> | 2015-08-27 10:40:20 +0100 |
---|---|---|
committer | David Schmitt <david.schmitt@puppetlabs.com> | 2015-08-27 10:42:13 +0100 |
commit | 2d4f5aa4d943e27ffeae524469f9c6eb18ce64d8 (patch) | |
tree | fca31ecf05fee935edd06ea1b2e8ed8aaa24fa84 /README.markdown | |
parent | 1bed010dbbd4590b3299c81b0e962e76b8ffa845 (diff) |
Adds a convert_base function, which can convert numbers between bases
Squashed, improved docs, updated error handling and unit tests by David S.
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown index 591c27b..ccbceab 100644 --- a/README.markdown +++ b/README.markdown @@ -155,6 +155,12 @@ Appends the contents of multiple arrays onto the first array given. For example: * `concat(['1','2','3'],'4',['5','6','7'])` returns ['1','2','3','4','5','6','7']. *Type*: rvalue. +#### `convert_base` + +Converts a given integer or base 10 string representing an integer to a specified base, as a string. For example: + * `convert_base(5, 2)` results in: '101' + * `convert_base('254', '16')` results in: 'fe' + #### `count` If called with only an array, it counts the number of elements that are **not** nil/undef. If called with a second argument, counts the number of elements in an array that matches the second argument. *Type*: rvalue. |