MCPcopy
hub / github.com/autoNumeric/autoNumeric / _getRawValueToFormat

Method _getRawValueToFormat

src/AutoNumeric.js:2356–2367  ·  view source on GitHub ↗

* Return the multiplied raw value with the `rawValueDivisor`. * This is used to display different values between the raw and formatted values. * * @param {number|string|null} rawValue The numeric value as understood by Javascript like a `Number` * @returns {number|string|null}

(rawValue)

Source from the content-addressed store, hash-verified

2354 * @private
2355 */
2356 _getRawValueToFormat(rawValue) {
2357 let rawValueForTheElementValue;
2358 if ((!AutoNumericHelper.isNull(this.settings.rawValueDivisor) && this.settings.rawValueDivisor !== 0) && // Only multiply if the `rawValueDivisor` option is set
2359 rawValue !== '' && rawValue !== null) { // Do not modify the `rawValue` if it's an empty string or null
2360 // !this._isUserManuallyEditingTheValue()) { // If the user is NOT manually changing the element value, but that is done programmatically
2361 rawValueForTheElementValue = rawValue * this.settings.rawValueDivisor;
2362 } else {
2363 rawValueForTheElementValue = rawValue;
2364 }
2365
2366 return rawValueForTheElementValue;
2367 }
2368
2369 /**
2370 * Check if the given value has a corresponding key in the `valuesToStrings` option object.

Callers 3

setMethod · 0.95

Calls 1

isNullMethod · 0.80

Tested by

no test coverage detected