uwc-amount-field components let users input and edit amounts, with optional formatting and currency display.

The amount field input component allows input and display of numbers with a number of options for CurrencySymbol, SymbolPosition, locale.
Transact's faster input multipliers by adding a suffix to the numeric data entered:

  • Thousands T: 1000,
  • Millions M: 1000000,
  • Billions B: 1000000000

Based on the CurrencyCode passed into the component, the CurrencySymbol, SymbolPosition, locale and the default number of decimal points are defaulted as per the table below. This component uses Intl.NumberFormat to enable language-sensitive number formatting with the help of locale passed in as argument

CurrencyCodelocaleCurrencySymbolSymbolPositionDefault decimal points
AEDar-AEد.إ,Right2
ARSes$Left2
AUDen$Left2
BRLptR$Left2
CADen-CA$Left2
CADfr-CA$Right2
CLPes-CL$Left0
CNYzh-CN¥Left2
COPen$Left2
CZKcsRight2
DKKdakr.Left2
EURdaLeft2
HKDen-HKHK$Left2
HUFhuFtRight2
INRen-INLeft2
ILShe-ILLeft2
JPYja-JP¥Left0
KRWkoLeft0
MYRms-MYRMLeft2
MXNes-MX$Left2
MADar-MA.د.م.Right2
NZDen-NZ$Left2
NOKnn-NOkr.Left2
PHPen-PHLeft2
PLNpl-PLRight2
RUBru-RUp.Right2
SARarRight2
SGDen-SG$Left2
ZARen-ZARLeft2
SEKsv-SEkrRight2
CHFgsw-CHfr.Left2
TWDzh-Hant-TWLeft2
THBth-TH฿Right2
TRYtr-TRRight2
GBPen-GB£Left2
USDen-US$Left2
VNDviRight0

It is possible to override the default configuration above, by passing in an alternative configuration object. An example is shown below, which shows the use of GBP as the currency symbol (instead of £). It should be noted that passing in a configuration property replaces the whole table above, it does not attempt to merge.

The <uwc-amount-field> component inherits from <uwc-text-field>, which itself inherits from mwc-text-field (Material Web Components), which itself extends the native HTML <input> element.

  • Supports most standard <input> attributes and properties.
  • Behaves similarly to an <input> field of type=number with added styling and functionality from mwc-text-field.
  • Can be used interchangeably with an <input> in terms of data binding and form submission.