UNPKG

@myorders/ember-ui

Version:

Myorders UI provides all the interface components, helpers, services and utilities for building a Myorders extension into the Console.

12 lines (9 loc) 265 B
export default function numbersOnly(string, keepDecimals = false) { if (typeof string !== 'string') { return string; } if (keepDecimals === true) { return string.replace(/[^0-9.]+/g, ''); } return string.replace(/\D+/g, ''); }