A ui:inputNumber component represents a number input field, which is rendered as an HTML input element of type text. It uses JavaScript’s Number type MAX_SAFE_INTEGER and MIN_SAFE_INTEGER precision to determine the supported number of digits, which is about 16 digits. Numbers outside of the precision can get truncated or rounded.
To apply Lightning Design System styling, we recommend that you use lightning:input with type="number" instead of ui:inputNumber. To render the output from a ui:inputNumber component, use the ui:outputNumber component. Similarly, we recommend using lightning:formattedNumber instead of ui:outputNumber.
This example shows a number field, which displays a value of 10.
To render the output from a ui:inputNumber component, use the ui:outputNumber component. When providing a number value with commas, use type="integer". This example returns 100,000.
The body of the component. In markup, this is everything in the body of the tag.
Aura.Component[]
class
A CSS style to be attached to the component. This style is added in addition to base styles output by the component.
String
disabled
Specifies whether the component should be displayed in a disabled state. Default value is "false".
Boolean
false
errors
The list of errors to be displayed.
Object[]
format
The format of the number. For example, format=“.00” displays the number followed by two decimal places. If not specified, the Locale default format will be used.
String
label
The text of the label component
String
labelClass
The CSS class of the label component
String
maxlength
The maximum number of characters that can be typed into the input field. Corresponds to the maxlength attribute of the rendered HTML input element.
Integer
placeholder
Text that is displayed when the field is empty, to prompt the user for a valid entry.
String
required
Specifies whether the input is required. Default value is "false".
Boolean
false
requiredIndicatorClass
The CSS class of the required indicator component
String
size
The width of the input field, in characters. Corresponds to the size attribute of the rendered HTML input element.
Integer
updateOn
Updates the component's value binding if the updateOn attribute is set to the handled event. Default value is "change".