UNPKG

bootstrap-vue

Version:

BootstrapVue, with over 40 plugins and more than 80 custom components, custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-AR

18 lines (16 loc) 705 B
// Number utilities // Converts a value (string, number, etc) to an integer number // Assumes radix base 10 // Returns NaN if the value cannot be converted export var toInteger = function toInteger(val) { return parseInt(val, 10); }; // Converts a value (string, number, etc) to a number // Returns NaN if the value cannot be converted export var toFloat = function toFloat(val) { return parseFloat(val); }; // Converts a value (string, number, etc) to a string // representation with 'precision' digits after the decimal // Returns the string 'NaN' if the value cannot be converted export var toFixed = function toFixed(val, precision) { return toFloat(val).toFixed(toInteger(precision) || 0); };