Properties
Property | Type | Description |
---|---|---|
value | number | (required) A number. |
srLabel | string | (optional) Will add a visually hidden label, to give screen reader users the missing context to easier understand what the number represents. |
locale | string | (optional) Use a 2 Letter Language Codes or an extended code such as nb-NO . Use auto to detect the locale from the browser (navigator.language ). Defaults to the Norwegian locale: nb-NO . |
compact | boolean string | (optional) Shortens any number or currency including an abbreviation. You can combine compact with currency . It gives you zero decimal by default decimals={0} . Use either short or long . Defaults to short if true is given. |
clean | boolean | (optional) If set to true a dirty string will be parsed to extract the number (prefix -123.45 suffix would result in e.g. kr -123,45 ). |
currency | string boolean | (optional) Currency code (ISO 4217) or true to use the default NOK . Uses two decimals by default. |
currency_display | string | (optional) Use either empty/false to hide the sign/name or use code (NOK), name (kroner), symbol (kr) or narrowSymbol (for a shorter symbol variant). Defaults to narrowSymbol when the locale is no else we default to code . |
currency_position | string | (optional) Use either before or after to change/define the position of the currency. Defaults to auto (Browser API defaults, but with an exception, if the locale is nb-NO or no , use after as the default position). |
ban | boolean | (optional) Bank Account Number: use true to use the default Norwegian style (2000 12 34567) formatting. |
nin | boolean | (optional) National Identification Number: use true to use the default Norwegian style (180892 12345) formatting. |
org | boolean | (optional) Organization Number: use true to use the default Norwegian style (123 456 789) formatting. Screen readers get digit by digit. |
percent | boolean | (optional) Percentage: use true to enable percent formatting. |
phone | boolean | (optional) Use true to use the default Norwegian style (22 22 22 22) of phone number formatting, regulated by the Norwegian authority. More info by Sprakradet as well. |
decimals | number | (optional) Set a number to define the number of decimals. Like decimals="0" will ensure that decimals are simply not shown. The default decimals for currency usage are 2 (Browser API default). |
rounding | omit half-even half-up | (optional) If omit is given, the decimal will NOT be rounded. If set to half-even , the value will be rounded to the nearest even number. If set to half-up , the fractional part is 0.5 or greater, the number is rounded up. If the fractional part is less than 0.5, the number is rounded down. Defaults to half-up . |
omit_rounding | boolean | (deprecated) Use rounding="omit" instead. |
prefix | React.Node | (optional) Add a string or React component before the number, including white space. |
suffix | React.Node | (optional) Appends a string or React component after the number, including white space. |
selectall | boolean | (optional) Use false to disable the auto select all on the first click. Defaults to true . |
always_selectall | boolean | (optional) Use true to always auto select all on the first click. Defaults to false . |
copy_selection | boolean | (optional) Use false to disable the auto copy feature. Defaults to true . |
clean_copy_value | boolean | (optional) If set to true the copy&paste value will be provided without e.g. a currency sign or a percent sign. Defaults to false . |
link | string | (optional) Use tel or sms to enable a clickable / touchable anchor link. |
monospace | boolean | (optional) Sets the font to DNB Mono Regular. |
element | string | (optional) Define what HTML element should be used. Defaults to <span> . |
options | object | (optional) Accepts all number.toLocaleString or Intl.NumberFormat options as an object - can also be a JSON given as the parameter e.g. options={{ 'minimumFractionDigits': 2 }} . |
skeleton | boolean | (optional) If set to true , an overlaying skeleton with animation will be shown. |
tooltip | React.Node | (optional) Provide a string or a React Element to be shown as the tooltip content. |
Space | string object | (optional) Spacing properties like top or bottom are supported. |
Translations
More info about translations can be found in the general localization and Eufemia Forms localization docs.
Key | nb-NO | en-GB |
---|---|---|
NumberFormat.clipboard_copy | Kopiert | Copied |
NumberFormat.not_available | Ikke tilgjengelig | Not available |