MCPcopy
hub / github.com/autoNumeric/autoNumeric / getNumber

Method getNumber

src/AutoNumeric.js:2528–2539  ·  view source on GitHub ↗

* Return the element unformatted value as a real Javascript number. * Warning: This can lead to precision problems with big numbers that should be stored as strings. * * @usage anElement.getNumber() * * @param {function|null} callback If a callback is passed, then the result

(callback = null)

Source from the content-addressed store, hash-verified

2526 * @returns {number|null}
2527 */
2528 getNumber(callback = null) {
2529 let result;
2530 if (this.rawValue === null) {
2531 result = null;
2532 } else {
2533 result = this.constructor._toLocale(this.getNumericString(), 'number', this.settings);
2534 }
2535
2536 this._executeCallback(result, callback);
2537
2538 return result;
2539 }
2540
2541 /**
2542 * Returns the unformatted value, but following the `outputFormat` setting, which means the output can either be :

Callers 3

constructorMethod · 0.80

Calls 4

getNumericStringMethod · 0.95
_executeCallbackMethod · 0.95
_getMethod · 0.95
_toLocaleMethod · 0.80

Tested by

no test coverage detected