File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -772,7 +772,7 @@ static observedAttributes = [
772772 if ( id != UNITS )
773773 txt . innerHTML = this . #formatNumber( this [ id ] ) ;
774774 else if ( this . units )
775- txt . innerHTML = ` ${ this . #locale . currency ? "/" : "" } ${ this . units } ` ;
775+ txt . innerHTML = this . #getUnits ( ) ;
776776 else
777777 txt . innerHTML = "" ;
778778
@@ -839,13 +839,12 @@ static observedAttributes = [
839839// #getText() gets the appropriate text for the #input
840840 #getText( inFocus , appendUnits ) {
841841 const n = this . #attrs[ VALUE ] ;
842- let txt = inFocus ? n : this . #formatNumber( n ) ;
843- if ( appendUnits && this . units ) {
844- if ( this . #locale. currency )
845- txt += "/" ; // currency && units displays currency per unit
846- txt += this . units ;
847- }
848- return txt ;
842+ return ( inFocus ? n : this . #formatNumber( n ) )
843+ + ( appendUnits && this . units ? this . #getUnits( ) : "" ) ;
844+ }
845+ // #getUnits() gets the units text, currency && units displays currency per unit
846+ #getUnits( ) {
847+ return `${ this . useLocale && this . #locale. currency ? "/" : "" } ${ this . units } ` ;
849848 }
850849// #formatNumber() formats a number for display as text
851850 #formatNumber( n ) {
You can’t perform that action at this time.
0 commit comments