MCPcopy Create free account
hub / github.com/UI5/webcomponents / _displayValue

Method _displayValue

packages/main/src/StepInput.ts:376–393  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

374 }
375
376 get _displayValue() {
377 if (this._languageChanged) {
378 this._languageChanged = false;
379 this.valueState = ValueState.None; // to reset the value state visual
380 return this._formatNumber(this.value);
381 }
382 // For the cases when there is set value precision but the input value is not with correct precision we don't need to format it
383 const value = this.input?.value && !this._isValueWithCorrectPrecision ? this.input.value : this._formatNumber(this.value);
384 if ((this.value === 0) || (Number.isInteger(this.value))) {
385 return value;
386 }
387
388 if (this.input && this.value === this._parseNumber(this.input.value)) { // For the cases where the number is fractional and is ending with 0s.
389 return this.input.value;
390 }
391
392 return value;
393 }
394
395 get accInfo(): InputAccInfo {
396 return {

Callers

nothing calls this directly

Calls 2

_formatNumberMethod · 0.95
_parseNumberMethod · 0.95

Tested by

no test coverage detected