MCPcopy
hub / github.com/autoNumeric/autoNumeric / formatAndSet

Method formatAndSet

src/AutoNumeric.js:4487–4492  ·  view source on GitHub ↗

* Format the given DOM element value, and set the resulting value back as the element value. * * @param {HTMLElement|HTMLInputElement} domElement * @param {object} options * @returns {string|null}

(domElement, options = null)

Source from the content-addressed store, hash-verified

4485 * @returns {string|null}
4486 */
4487 static formatAndSet(domElement, options = null) { //FIXME test this
4488 const formattedValue = this.format(domElement, options);
4489 AutoNumericHelper.setElementValue(domElement, formattedValue);
4490
4491 return formattedValue;
4492 }
4493
4494 /**
4495 * Unformat the given formatted string with the given options. This returns a numeric string.

Callers

nothing calls this directly

Calls 2

formatMethod · 0.95
setElementValueMethod · 0.80

Tested by

no test coverage detected