Created
March 30, 2019 19:38
-
-
Save jonasraoni/368062ab9acfb04538e5279f0e41cc7b to your computer and use it in GitHub Desktop.
Given a list of numeric arguments, retrieves the longest amount of decimal places, useful to format :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default (...values) => Math.max(...values.map(value => | |
(value = (value + '').split(/[.,]/)).length > 1 && value.pop().length | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment