* Return the number of decimal places if the parameter is a string that represents a float number, and that number has a decimal part. * * @param {string} str * @returns {int}
(str)
| 295 | * @returns {int} |
| 296 | */ |
| 297 | static decimalPlaces(str) { |
| 298 | const [, decimalPart] = str.split('.'); |
| 299 | if (!this.isUndefined(decimalPart)) { |
| 300 | return decimalPart.length; |
| 301 | } |
| 302 | |
| 303 | return 0; |
| 304 | } |
| 305 | |
| 306 | /** |
| 307 | * Return the index of the first non-zero decimal place in the given value. |
no test coverage detected