MCPcopy
hub / github.com/autoNumeric/autoNumeric / clampToRangeLimits

Method clampToRangeLimits

src/AutoNumericHelper.js:593–596  ·  view source on GitHub ↗

* Return the value clamped to the nearest minimum/maximum value, as defined in the settings. * * @param {string|number} value * @param {object} settings * @returns {number}

(value, settings)

Source from the content-addressed store, hash-verified

591 * @returns {number}
592 */
593 static clampToRangeLimits(value, settings) {
594 //XXX This function always assume `settings.minimumValue` is lower than `settings.maximumValue`
595 return Math.max(settings.minimumValue, Math.min(settings.maximumValue, value));
596 }
597
598 /**
599 * Return the number of number or dot characters on the left side of the caret, in a formatted number.

Callers 3

_onPasteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected